Commit 02afc4d3 by 杨明

fixed

1 parent 6c22c1b2
Showing 71 changed files with 2824 additions and 930 deletions
...@@ -5,16 +5,19 @@ ...@@ -5,16 +5,19 @@
"scripts": { "scripts": {
"serve": "vue-cli-service serve", "serve": "vue-cli-service serve",
"build": "vue-cli-service build", "build": "vue-cli-service build",
"lint": "vue-cli-service lint" "lint": "vue-cli-service lint",
"build:test": "vue-cli-service build --mode test"
}, },
"dependencies": { "dependencies": {
"axios": "^0.21.1", "axios": "^0.21.1",
"core-js": "^3.4.4", "core-js": "^3.4.4",
"el-tree-transfer": "^2.2.6", "el-tree-transfer": "^2.2.6",
"glsx-common": "^1.4.6", "glsx-common": "^1.4.9",
"glsx-components": "^1.2.8", "glsx-components": "^1.4.7",
"glsx-table": "^1.0.9", "glsx-table": "^1.0.9",
"vue-draggable-resizable": "^2.3.0" "vue-draggable-resizable": "^2.3.0",
"vuedraggable": "^2.24.3",
"xlsx": "^0.18.5"
}, },
"devDependencies": { "devDependencies": {
"@vue/cli-plugin-babel": "^4.1.0", "@vue/cli-plugin-babel": "^4.1.0",
...@@ -26,7 +29,6 @@ ...@@ -26,7 +29,6 @@
"autoprefixer": "^8.0.0", "autoprefixer": "^8.0.0",
"babel-eslint": "^10.0.3", "babel-eslint": "^10.0.3",
"babel-plugin-component": "^1.1.1", "babel-plugin-component": "^1.1.1",
"babel-plugin-transform-remove-console": "^6.9.4",
"element-theme-chalk": "^2.15.6", "element-theme-chalk": "^2.15.6",
"eslint": "^5.16.0", "eslint": "^5.16.0",
"eslint-plugin-prettier": "^3.1.1", "eslint-plugin-prettier": "^3.1.1",
......
...@@ -18,7 +18,7 @@ export default { ...@@ -18,7 +18,7 @@ export default {
} }
}, },
created() { created() {
document.onkeydown = function () { document.onkeydown = function() {
var evt = window.event || arguments[0] var evt = window.event || arguments[0]
if (evt && evt.keyCode == 13) { if (evt && evt.keyCode == 13) {
if (typeof evt.cancelBubble != 'undefined') evt.cancelBubble = true if (typeof evt.cancelBubble != 'undefined') evt.cancelBubble = true
...@@ -31,7 +31,7 @@ export default { ...@@ -31,7 +31,7 @@ export default {
this.myMessage = this.message this.myMessage = this.message
} }
} }
</script> </script>
<style lang="scss"> <style lang="scss">
.parent-child-communication { .parent-child-communication {
...@@ -40,7 +40,7 @@ export default { ...@@ -40,7 +40,7 @@ export default {
} }
#app { #app {
background: #f4f5fa; background: #f4f5fa;
padding: 0px 20px 20px 40px; padding: 0px 20px 20px 20px;
position: absolute; position: absolute;
box-sizing: border-box; box-sizing: border-box;
width: 100%; width: 100%;
...@@ -49,4 +49,4 @@ export default { ...@@ -49,4 +49,4 @@ export default {
overflow-y: auto; overflow-y: auto;
height: 100%; height: 100%;
} }
</style>
\ No newline at end of file \ No newline at end of file
</style>
...@@ -6,185 +6,196 @@ ...@@ -6,185 +6,196 @@
* @param {*} params * @param {*} params
* @returns * @returns
*/ */
import { http,http_tag } from '@/main' import { http, http_tag } from '@/main'
let session = 'mini-c38a80dd-cf48-4491-8933-fb2eb57fb4ca-rop' let session = 'mini-c38a80dd-cf48-4491-8933-fb2eb57fb4ca-rop'
const getListApi = params => { const getListApi = params => {
params.method = 'entmicro.api.staff.listFollowerStaffByPage' params.method = 'entmicro.api.staff.listFollowerStaffByPage'
params.sessionId = session params.sessionId = session
return http({ return http({
url: '/rop-scrm-entmicro/router', url: '/rop-scrm-entmicro/router',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
} }
const getFollower = params => { const getFollower = params => {
params.method = 'entmicro.api.staff.listFollowerStaffByPage' params.method = 'entmicro.api.staff.listFollowerStaffByPage'
params.sessionId = session params.sessionId = session
return http({ return http({
url: '/rop-scrm-entmicro/router', url: '/rop-scrm-entmicro/router',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
} }
const querylabeltree = params => { const querylabeltree = params => {
params.method = 'scrm.api.datahub.labelgroup.queryLabelTree' params.method = 'scrm.api.datahub.labelgroup.queryLabelTree'
params.sessionId = session params.sessionId = session
return http_tag({ return http_tag({
url: '/rop-scrm-datahub/router', url: '/rop-scrm-datahub/router',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
}
const queryCrowdtree = params => {
params.method = 'scrm.api.datahub.user.queryCrowdTree'
return http_tag({
url: '/rop-scrm-datahub/router',
method: 'POST',
data: params,
sign: true
})
} }
const deleteChannelCodeBill = params => { const deleteChannelCodeBill = params => {
params.method = 'entmicro.api.code.deleteChannelCodeBill' params.method = 'entmicro.api.code.deleteChannelCodeBill'
params.sessionId = session params.sessionId = session
return http({ return http({
url: '/rop-scrm-entmicro/router', url: '/rop-scrm-entmicro/router',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
} }
const getSubCodeChannelCodeBill = params => { const getSubCodeChannelCodeBill = params => {
params.method = 'entmicro.api.code.getSubCodeChannelCodeBill' params.method = 'entmicro.api.code.getSubCodeChannelCodeBill'
params.sessionId = session params.sessionId = session
return http({ return http({
url: '/rop-scrm-entmicro/router', url: '/rop-scrm-entmicro/router',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
} }
const saveChannelCodeBill = params => { const saveChannelCodeBill = params => {
params.method = 'entmicro.api.code.saveChannelCodeBill' params.method = 'entmicro.api.code.saveChannelCodeBill'
params.sessionId = session params.sessionId = session
return http({ return http({
url: '/rop-scrm-entmicro/router', url: '/rop-scrm-entmicro/router',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
} }
const updateChannelCodeBill = params => { const updateChannelCodeBill = params => {
params.method = 'entmicro.api.code.updateChannelCodeBill' params.method = 'entmicro.api.code.updateChannelCodeBill'
params.sessionId = session params.sessionId = session
return http({ return http({
url: '/rop-scrm-entmicro/router', url: '/rop-scrm-entmicro/router',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
} }
const listChannelCodeBill = params => { const listChannelCodeBill = params => {
params.method = 'entmicro.api.code.listChannelCodeBill' params.method = 'entmicro.api.code.listChannelCodeBill'
params.sessionId = session params.sessionId = session
return http({ return http({
url: '/rop-scrm-entmicro/router', url: '/rop-scrm-entmicro/router',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
} }
const deleteChannelCode = params => { const deleteChannelCode = params => {
params.method = 'entmicro.api.code.deleteChannelCode' params.method = 'entmicro.api.code.deleteChannelCode'
params.sessionId = session params.sessionId = session
return http({ return http({
url: '/rop-scrm-entmicro/router', url: '/rop-scrm-entmicro/router',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
} }
const detailChannelCode = params => { const detailChannelCode = params => {
params.method = 'entmicro.api.code.detailChannelCode' params.method = 'entmicro.api.code.detailChannelCode'
params.sessionId = session params.sessionId = session
return http({ return http({
url: '/rop-scrm-entmicro/router', url: '/rop-scrm-entmicro/router',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
} }
const listChannelCodeByPage = params => { const listChannelCodeByPage = params => {
params.method = 'entmicro.api.code.listChannelCodeByPage' params.method = 'entmicro.api.code.listChannelCodeByPage'
params.sessionId = session params.sessionId = session
return http({ console.log(http)
url: '/rop-scrm-entmicro/router', return http({
method: 'POST', url: '/rop-scrm-entmicro/router',
data: params, method: 'POST',
sign: true data: params,
}) sign: true
})
} }
const saveChannelCode = params => { const saveChannelCode = params => {
params.method = 'entmicro.api.code.saveChannelCode' params.method = 'entmicro.api.code.saveChannelCode'
params.sessionId = session params.sessionId = session
return http({ return http({
url: '/rop-scrm-entmicro/router', url: '/rop-scrm-entmicro/router',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
} }
const updateChannelCode = params => { const updateChannelCode = params => {
params.method = 'entmicro.api.code.updateChannelCode' params.method = 'entmicro.api.code.updateChannelCode'
params.sessionId = session params.sessionId = session
return http({ return http({
url: '/rop-scrm-entmicro/router', url: '/rop-scrm-entmicro/router',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
} }
const getCustomer = params => { const getCustomer = params => {
params.method = 'entmicro.api.customer.code.page' params.method = 'entmicro.api.customer.code.page'
params.sessionId = session params.sessionId = session
return http({ return http({
url: '/rop-scrm-entmicro/router', url: '/rop-scrm-entmicro/router',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
} }
const getChannelCodeStaffList = params => { const getChannelCodeStaffList = params => {
params.method = 'entmicro.api.code.getChannelCodeStaffList' params.method = 'entmicro.api.code.getChannelCodeStaffList'
params.sessionId = session params.sessionId = session
return http({ return http({
url: '/rop-scrm-entmicro/router', url: '/rop-scrm-entmicro/router',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
} }
const getStatus = params => { const getStatus = params => {
params.method = 'scrm.api.work.wechat.access.status' params.method = 'scrm.api.work.wechat.access.status'
params.sessionId = session params.sessionId = session
return http({ return http({
url: '/rop-scrm-wechat/router', url: '/rop-scrm-wechat/router',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
} }
export default { export default {
getStatus,
getListApi,
getFollower,
querylabeltree,
saveChannelCodeBill,
getSubCodeChannelCodeBill,
deleteChannelCodeBill,
updateChannelCode,
saveChannelCode,
listChannelCodeByPage,
detailChannelCode,
deleteChannelCode,
updateChannelCodeBill,
listChannelCodeBill,
getCustomer,
getChannelCodeStaffList
}
\ No newline at end of file \ No newline at end of file
getStatus,
getListApi,
getFollower,
querylabeltree,
saveChannelCodeBill,
getSubCodeChannelCodeBill,
deleteChannelCodeBill,
updateChannelCode,
saveChannelCode,
listChannelCodeByPage,
detailChannelCode,
deleteChannelCode,
updateChannelCodeBill,
listChannelCodeBill,
getCustomer,
getChannelCodeStaffList,
queryCrowdtree
}
...@@ -6,17 +6,53 @@ ...@@ -6,17 +6,53 @@
* @param {*} params * @param {*} params
* @returns * @returns
*/ */
import { http_common } from '@/main' import { http_common, http } from '@/main'
const pictureUpload = params => { const pictureUpload = params => {
params.method = "glsx.accounts.biz.common.pictureUpload" params.method = 'glsx.accounts.biz.common.pictureUpload'
return http_common({ return http_common({
url: '/router?method=glsx.accounts.biz.common.pictureUpload', url: '/router?method=glsx.accounts.biz.common.pictureUpload',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true, sign: true,
noSignAttr: ['file'] noSignAttr: ['file']
}) })
}
// const pictureUpload = params => {
// params.method = 'scrm.api.equity.common.upload.common.multiple'
// return http({
// url: 'rop-scrm-equity/router',
// data: params,
// sign: true,
// noSignAttr: ['file']
// })
// }
const getUploadFileToken = params => {
params.method = 'glsx.accounts.biz.common.getUploadFileToken'
return http_common({
url: 'http://qcdidicb.glsx.com.cn:7060/router',
method: 'get',
data: params
})
}
const checkAndListFragmentDetail = params => {
params.method = 'glsx.accounts.biz.common.checkAndListFragmentDetail'
return http_common({
url: 'http://qcdidicb.glsx.com.cn:7060/router',
method: 'get',
data: params
})
}
const uploadFileWithFileInfo = params => {
params.method = 'glsx.accounts.biz.common.uploadFileWithFileInfo'
return http_common({
url: 'http://qcdidicb.glsx.com.cn:7060/router',
method: 'get',
data: params
})
} }
export default { export default {
pictureUpload
}
\ No newline at end of file \ No newline at end of file
pictureUpload,
getUploadFileToken,
checkAndListFragmentDetail,
uploadFileWithFileInfo
}
...@@ -9,185 +9,196 @@ ...@@ -9,185 +9,196 @@
import { http } from '@/main' import { http } from '@/main'
let session = 'mini-57c1c42e-8a0c-4fc3-959c-b62813a471cd-rop' let session = 'mini-57c1c42e-8a0c-4fc3-959c-b62813a471cd-rop'
const getCoupon = params => { const getCoupon = params => {
params.method = 'scrm.api.boutiquecoupon.coupon.page' params.method = 'scrm.api.boutiquecoupon.coupon.page'
return http({ return http({
url: '/rop-scrm-boutiquecoupon/router', url: '/rop-scrm-boutiquecoupon/router',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
} }
const getMerchant = params => { const getMerchant = params => {
params.method = 'scrm.api.coupon.list.merchant' params.method = 'scrm.api.coupon.list.merchant'
return http({ return http({
url: 'rop-scrm-coupon/router', url: 'rop-scrm-coupon/router',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
} }
const getCard = params => { const getCard = params => {
params.method = 'scrm.api.equity.open.card.price.list.by.merchantid' params.method = 'scrm.api.equity.open.card.price.list.by.merchantid'
return http({ return http({
url: 'rop-scrm-equity/router', url: 'rop-scrm-equity/router',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
} }
const merchantOpen = params => { const merchantOpen = params => {
params.method = 'scrm.api.equity.service.merchant.config.get' params.method = 'scrm.api.equity.service.merchant.config.get'
return http({ return http({
url: 'rop-scrm-equity/router', url: 'rop-scrm-equity/router',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
} }
const merchant = params => { const merchant = params => {
params.method = 'scrm.api.equity.open.card.price.list.by.merchantid' params.method = 'scrm.api.equity.open.card.price.list.by.merchantid'
return http({ return http({
url: 'rop-scrm-equity/router', url: 'rop-scrm-equity/router',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
} }
const getPackage = params => { const getPackage = params => {
params.method = 'scrm.api.equity.package.info.list.with.page' params.method = 'scrm.api.equity.package.info.list.with.page'
return http({ return http({
url: 'rop-scrm-equity/router', url: 'rop-scrm-equity/router',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
} }
const getActivity = params => { const getActivity = params => {
params.method = 'scrm.api.shopmall.activity.page' params.method = 'scrm.api.shopmall.activity.page'
return http({ return http({
url: 'rop-scrm-shopmall/router', url: 'rop-scrm-shopmall/router',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
} }
const findAllByPage = params => { const findAllByPage = params => {
params.method = 'entmicro.api.dracIm.findAllByPage' params.method = 'entmicro.api.dracIm.findAllByPage'
params.sessionId = session params.sessionId = session
return http({ return http({
url: 'rop-scrm-entmicro/router', url: 'rop-scrm-entmicro/router',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
} }
const exportAdd = params => { const exportAdd = params => {
params.method = 'entmicro.api.dracIm.exportAdd' params.method = 'entmicro.api.dracIm.exportAdd'
params.sessionId = session params.sessionId = session
return http({ return http({
url: 'rop-scrm-entmicro/router', url: 'rop-scrm-entmicro/router',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
} }
const exportUpdate = params => { const exportUpdate = params => {
params.method = 'entmicro.api.dracIm.exportUpdate' params.method = 'entmicro.api.dracIm.exportUpdate'
params.sessionId = session params.sessionId = session
return http({ return http({
url: 'rop-scrm-entmicro/router', url: 'rop-scrm-entmicro/router',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
} }
const findById = params => { const findById = params => {
params.method = 'entmicro.api.dracIm.findById' params.method = 'entmicro.api.dracIm.findById'
params.sessionId = session params.sessionId = session
return http({ return http({
url: 'rop-scrm-entmicro/router', url: 'rop-scrm-entmicro/router',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
} }
const dracImMessage = params => { const dracImMessage = params => {
params.method = 'entmicro.api.dracImMessage.findAllByCondition' params.method = 'entmicro.api.dracImMessage.findAllByCondition'
params.sessionId = session params.sessionId = session
return http({ return http({
url: 'rop-scrm-entmicro/router', url: 'rop-scrm-entmicro/router',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
} }
const listChannelCodeBill = params => { const listChannelCodeBill = params => {
params.method = 'entmicro.api.code.listChannelCodeBill' params.method = 'entmicro.api.code.listChannelCodeBill'
params.sessionId = session params.sessionId = session
return http({ return http({
url: '/rop-scrm-entmicro/router', url: '/rop-scrm-entmicro/router',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
} }
const addConfig = params => { const addConfig = params => {
params.method = 'entmicro.api.dracImConfig.addConfig' params.method = 'entmicro.api.dracImConfig.addConfig'
params.sessionId = session params.sessionId = session
return http({ return http({
url: '/rop-scrm-entmicro/router', url: '/rop-scrm-entmicro/router',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
} }
const findConfig = params => { const findConfig = params => {
params.method = 'entmicro.api.dracImConfig.findConfig' params.method = 'entmicro.api.dracImConfig.findConfig'
params.sessionId = session params.sessionId = session
return http({ return http({
url: '/rop-scrm-entmicro/router', url: '/rop-scrm-entmicro/router',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
} }
const updateConfig = params => { const updateConfig = params => {
params.method = 'entmicro.api.dracImConfig.updateConfig' params.method = 'entmicro.api.dracImConfig.updateConfig'
params.sessionId = session params.sessionId = session
return http({ return http({
url: '/rop-scrm-entmicro/router', url: '/rop-scrm-entmicro/router',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
} }
const customerPage = params => { const customerPage = params => {
params.method = 'entmicro.api.dracIm.customer.search.page' params.method = 'entmicro.api.dracIm.customer.search.page'
params.sessionId = session params.sessionId = session
return http({ return http({
url: '/rop-scrm-entmicro/router', url: '/rop-scrm-entmicro/router',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
}
const findMerchantInfoByMerchantNo = params => {
params.method = 'entmicro.api.common.findMerchantInfoByMerchantNo.list'
params.sessionId = session
return http({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
} }
export default { export default {
getCoupon,
getMerchant,
merchantOpen,
merchant,
getCard,
getPackage,
getActivity,
listChannelCodeBill,
findAllByPage,
dracImMessage,
exportAdd,
exportUpdate,
findById,
updateConfig,
findConfig,
addConfig,
customerPage
}
\ No newline at end of file \ No newline at end of file
getCoupon,
getMerchant,
merchantOpen,
merchant,
getCard,
getPackage,
getActivity,
listChannelCodeBill,
findAllByPage,
dracImMessage,
exportAdd,
exportUpdate,
findById,
updateConfig,
findConfig,
addConfig,
customerPage,
findMerchantInfoByMerchantNo
}
...@@ -9,123 +9,123 @@ ...@@ -9,123 +9,123 @@
import { http } from '@/main' import { http } from '@/main'
let session = 'mini-c38a80dd-cf48-4491-8933-fb2eb57fb4ca-rop' let session = 'mini-c38a80dd-cf48-4491-8933-fb2eb57fb4ca-rop'
const codeDefault = params => { const codeDefault = params => {
params.method = 'entmicro.api.drac.statistic.code.default' params.method = 'entmicro.api.drac.statistic.code.default'
return http({ return http({
url: '/rop-scrm-entmicro/router', url: '/rop-scrm-entmicro/router',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
} }
const listStaff = params => { const listStaff = params => {
params.method = 'entmicro.api.drac.statistic.code.detail.list.staff' params.method = 'entmicro.api.drac.statistic.code.detail.list.staff'
return http({ return http({
url: 'rop-scrm-entmicro/router', url: 'rop-scrm-entmicro/router',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
} }
const listTime = params => { const listTime = params => {
params.method = 'entmicro.api.drac.statistic.code.detail.list.time' params.method = 'entmicro.api.drac.statistic.code.detail.list.time'
return http({ return http({
url: 'rop-scrm-entmicro/router', url: 'rop-scrm-entmicro/router',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
} }
const detailTotal = params => { const detailTotal = params => {
params.method = 'entmicro.api.drac.statistic.code.detail.total' params.method = 'entmicro.api.drac.statistic.code.detail.total'
return http({ return http({
url: 'rop-scrm-entmicro/router', url: 'rop-scrm-entmicro/router',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
} }
const codeSearch = params => { const codeSearch = params => {
params.method = 'entmicro.api.drac.statistic.code.search' params.method = 'entmicro.api.drac.statistic.code.search'
params.sessionId = session params.sessionId = session
return http({ return http({
url: 'rop-scrm-entmicro/router', url: 'rop-scrm-entmicro/router',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
} }
const codeTrend = params => { const codeTrend = params => {
params.method = 'entmicro.api.drac.statistic.code.trend' params.method = 'entmicro.api.drac.statistic.code.trend'
params.sessionId = session params.sessionId = session
return http({ return http({
url: 'rop-scrm-entmicro/router', url: 'rop-scrm-entmicro/router',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
} }
const dayTrend = params => { const dayTrend = params => {
params.method = 'entmicro.api.drac.statistic.day.trend' params.method = 'entmicro.api.drac.statistic.day.trend'
params.sessionId = session params.sessionId = session
return http({ return http({
url: 'rop-scrm-entmicro/router', url: 'rop-scrm-entmicro/router',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
} }
const overview = params => { const overview = params => {
params.method = 'entmicro.api.drac.statistic.overview' params.method = 'entmicro.api.drac.statistic.overview'
params.sessionId = session params.sessionId = session
return http({ return http({
url: 'rop-scrm-entmicro/router', url: 'rop-scrm-entmicro/router',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
} }
const findMessageStatic = params => { const findMessageStatic = params => {
params.method = 'entmicro.api.dracIm.findMessageStatic' params.method = 'entmicro.api.dracIm.findMessageStatic'
params.sessionId = session params.sessionId = session
return http({ return http({
url: 'rop-scrm-entmicro/router', url: 'rop-scrm-entmicro/router',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
} }
const viewChart = params => { const viewChart = params => {
params.method = 'entmicro.api.drac.statistic.getCustomerStatisticCodeTrend' params.method = 'entmicro.api.drac.statistic.getCustomerStatisticCodeTrend'
params.sessionId = session params.sessionId = session
return http({ return http({
url: 'rop-scrm-entmicro/router', url: 'rop-scrm-entmicro/router',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
} }
const findAllMessageByPage = params => { const findAllMessageByPage = params => {
params.method = 'entmicro.api.dracIm.findAllMessageByPage' params.method = 'entmicro.api.dracIm.findAllMessageByPage'
params.sessionId = session params.sessionId = session
return http({ return http({
url: 'rop-scrm-entmicro/router', url: 'rop-scrm-entmicro/router',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
} }
export default { export default {
codeDefault,
listStaff,
listTime,
detailTotal,
codeSearch,
codeTrend,
dayTrend,
overview,
viewChart,
findMessageStatic,
findAllMessageByPage
}
\ No newline at end of file \ No newline at end of file
codeDefault,
listStaff,
listTime,
detailTotal,
codeSearch,
codeTrend,
dayTrend,
overview,
viewChart,
findMessageStatic,
findAllMessageByPage
}
...@@ -9,80 +9,115 @@ ...@@ -9,80 +9,115 @@
import { http } from '@/main' import { http } from '@/main'
let session = 'mini-c38a80dd-cf48-4491-8933-fb2eb57fb4ca-rop' let session = 'mini-c38a80dd-cf48-4491-8933-fb2eb57fb4ca-rop'
const importsUpload = params => { const importsUpload = params => {
params.method = 'entmicro.api.imports.upload' params.method = 'entmicro.api.imports.upload'
params.sessionId = session params.sessionId = session
return http({ return http({
url: '/rop-scrm-entmicro/router', url: '/rop-scrm-entmicro/router',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
} }
const downloadModel = params => { const downloadModel = params => {
params.method = 'entmicro.api.imports.download.model' params.method = 'entmicro.api.imports.download.model'
params.sessionId = session params.sessionId = session
return http({ return http({
url: 'rop-scrm-entmicro/router', url: 'rop-scrm-entmicro/router',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
} }
const merchantConfig = params => {
params.method = 'entmicro.api.datacube.merchant.config'
params.sessionId = session
return http({
url: 'rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
const datacubeUpload = params => {
params.method = 'entmicro.api.datacube.upload'
params.sessionId = session
return http({
url: 'rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
const importsRecord = params => { const importsRecord = params => {
params.method = 'entmicro.api.imports.record.page' params.method = 'entmicro.api.datacube.log.page'
params.sessionId = session params.sessionId = session
return http({ return http({
url: 'rop-scrm-entmicro/router', url: 'rop-scrm-entmicro/router',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
} }
const importsRecordSearch = params => { const datacubeNotice = params => {
params.method = 'entmicro.api.imports.record.search' params.method = 'entmicro.api.datacube.notice.pc'
params.sessionId = session params.sessionId = session
return http({ return http({
url: 'rop-scrm-entmicro/router', url: 'rop-scrm-entmicro/router',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
} }
const importsCount = params => { const importsCount = params => {
params.method = 'entmicro.api.imports.count' params.method = 'entmicro.api.imports.count'
params.sessionId = session params.sessionId = session
return http({ return http({
url: 'rop-scrm-entmicro/router', url: 'rop-scrm-entmicro/router',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
} }
const importsKey = params => { const importsKey = params => {
params.method = 'entmicro.api.imports.record.key' params.method = 'entmicro.api.imports.record.key'
params.sessionId = session params.sessionId = session
return http({ return http({
url: 'rop-scrm-entmicro/router', url: 'rop-scrm-entmicro/router',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
} }
const findLoginCount = params => { const findLoginCount = params => {
params.method = 'entmicro.api.common.findLoginCount' params.method = 'entmicro.api.common.findLoginCount'
return http({ return http({
url: 'rop-scrm-entmicro/router', url: 'rop-scrm-entmicro/router',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
}
const queryCrowdTree = params => {
params.method = 'scrm.api.datahub.user.queryCrowdTree'
return http({
url: 'rop-scrm-datahub/router',
method: 'POST',
data: params,
sign: true
})
} }
export default { export default {
importsUpload,
downloadModel,
importsRecord,
importsRecordSearch,
importsCount,
importsKey,
findLoginCount
}
\ No newline at end of file \ No newline at end of file
importsUpload,
downloadModel,
importsRecord,
importsCount,
importsKey,
findLoginCount,
datacubeUpload,
merchantConfig,
datacubeNotice,
queryCrowdTree
}
import { http } from '@/main'
const path = 'entmicro.api.mass.'
const URL = 'rop-scrm-entmicro/router'
//权益卡
const getCard = params => {
params.method = 'scrm.api.equity.open.card.price.list.by.merchantid'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
//权益卡
const merchant = params => {
params.method = 'scrm.api.equity.open.card.price.list.by.merchantid'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
//是否开通权益
const merchantOpen = params => {
params.method = 'scrm.api.equity.service.merchant.config.get'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
//优惠券
const getCoupon = params => {
params.method = 'scrm.api.boutiquecoupon.coupon.page'
return http({
url: '/rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
//套餐
const getPackage = params => {
params.method = 'scrm.api.equity.package.info.list.with.page'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
const getMerchant = params => {
params.method = 'scrm.api.coupon.list.merchant'
return http({
url: 'rop-scrm-coupon/router',
method: 'POST',
data: params,
sign: true
})
}
//秒杀活动
const getActivity = params => {
params.method = 'scrm.api.shopmall.activity.page'
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
// 获取素材组列表
const getGroupListApi = params => {
params.method = 'marketing.api.material.group.list'
return http({
url: 'rop-scrm-marketing/router',
method: 'POST',
data: params,
sign: true
})
}
// 获取素材列表
const getMaterialListApi = params => {
// params.method = 'marketing.api.material.page'
params.method = 'marketing.api.material.sop.page'
return http({
url: 'rop-scrm-marketing/router',
method: 'POST',
data: params,
sign: true
})
}
//模板列表
const templatePage = params => {
params.method = `${path}template.page.search`
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
//模板保存
const templateSave = params => {
params.method = `${path}template.save`
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
//模板更新
const templateUpdate = params => {
params.method = `${path}template.update`
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
//模板创建人
const createdNameList = params => {
params.method = `${path}template.created.name.list`
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
export default {
getCard,
merchant,
getActivity,
getPackage,
getMerchant,
getCoupon,
merchantOpen,
getGroupListApi,
getMaterialListApi,
templatePage,
createdNameList,
templateUpdate,
templateSave
}
...@@ -101,7 +101,7 @@ img { ...@@ -101,7 +101,7 @@ img {
.scrm-box-f { .scrm-box-f {
background: #ffffff; background: #ffffff;
box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1); // box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1);
} }
.scrm-flex { .scrm-flex {
...@@ -173,11 +173,6 @@ img { ...@@ -173,11 +173,6 @@ img {
.el-message-box--center { .el-message-box--center {
padding: 0px; padding: 0px;
} }
.count-item-question {
width: 14px;
height: 14px;
display: inline-block;
}
.el-message--info { .el-message--info {
height: 40px; height: 40px;
background: #e6e9ff; background: #e6e9ff;
...@@ -190,3 +185,6 @@ img { ...@@ -190,3 +185,6 @@ img {
color: #5850ff; color: #5850ff;
font-size: 16px; font-size: 16px;
} }
.el-radio:focus:not(.is-focus):not(:active):not(.is-disabled) .el-radio__inner {
box-shadow: none !important;
}

644 Bytes | W: | H:

527 Bytes | W: | H:

src/assets/img/question.png
src/assets/img/question.png
src/assets/img/question.png
src/assets/img/question.png
  • 2-up
  • Swipe
  • Onion skin
import GLCombiForm from './src/index.vue'
// 为组件提供 install 安装方法,供按需引入
GLCombiForm.install = function(Vue) {
Vue.component(GLCombiForm.name, GLCombiForm)
}
// 默认导出组件
export default GLCombiForm
\ No newline at end of file \ No newline at end of file
/**
* 时间控件-限制月份
*/
export const beforeRangePickerOptions = {
disabledDate(date) {
if (date > new Date()) {
return true
}
return false
}
}
export const afterRangePickerOptions = {
disabledDate(date) {
const yesterday = new Date(new Date().setDate(new Date().getDate() - 1))
if (date < yesterday) {
return true
}
return false
}
}
import GLSearch from './src/index.vue'
// 为组件提供 install 安装方法,供按需引入
GLSearch.install = function(Vue) {
Vue.component(GLSearch.name, GLSearch)
}
// 默认导出组件
export default GLSearch
\ No newline at end of file \ No newline at end of file
<!-- <content> -->
<GLSearch @onOk="handleOkFn" @onRest="handleRestFn">
<GLSearchItem>
<div slot="name">我是文本输入框</div>
<el-input size="small" v-model="input" placeholder="请输入内容"></el-input>
</GLSearchItem>
<GLSearchItem>
<div slot="name">我是文本输入框</div>
<el-select v-model="value" size="small" placeholder="请选择">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
</GLSearchItem>
<GLSearchItem>
<div slot="name">我是文本输入框</div>
<el-date-picker size="small" v-model="value1" type="datetimerange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
</GLSearchItem>
<GLSearchItem>
<el-select v-model="selvalue" placeholder="请选择" size="small" slot="name">
<el-option v-for="item in seloptions" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
<el-input size="small" v-model="input" placeholder="请输入内容"></el-input>
</GLSearchItem>
</GLSearch>
<el-button type="warning" @click="toggleShow(1)">显示代码</el-button>
```js {mixin:true}
{
data() {
return {
demo1: true,
//gl-search数据
input: '',
options: [
{
value: '选项1',
label: '黄金糕'
},
{
value: '选项2',
label: '双皮奶'
},
{
value: '选项3',
label: '蚵仔煎'
},
{
value: '选项4',
label: '龙须面'
},
{
value: '选项5',
label: '北京烤鸭'
}
],
value: '',
value1: [new Date(2000, 10, 10, 10, 10), new Date(2000, 10, 11, 10, 10)],
seloptions: [
{
value: '选项1',
label: '黄金糕'
},
{
value: '选项2',
label: '双皮奶'
},
{
value: '选项3',
label: '蚵仔煎北京烤鸭'
},
{
value: '选项4',
label: '龙须面北京烤鸭'
},
{
value: '选项5',
label: '北京烤鸭北京烤鸭'
}
],
selvalue: ''
}
},
methods:{
toggleShow(num){
// console.log(123)
this['demo' + num] = !this['demo' + num]
},
//gl-search 方法
handleOkFn() {
console.log('您点击了确定')
},
handleRestFn() {
console.log('您点击了取消')
}
}
}
```
# 用来作为 markdown 代码的示例部分
<div v-if="demo1">
```vue
<template>
<GLSearch @onOk="handleOkFn" @onRest="handleRestFn">
<GLSearchItem>
<div slot="name">我是文本输入框</div>
<el-input size="small" v-model="input" placeholder="请输入内容"></el-input>
</GLSearchItem>
<GLSearchItem>
<div slot="name">我是文本输入框</div>
<el-select v-model="value" size="small" placeholder="请选择">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
</GLSearchItem>
<GLSearchItem>
<div slot="name">我是文本输入框</div>
<el-date-picker size="small" v-model="value1" type="datetimerange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
</GLSearchItem>
<GLSearchItem>
<el-select v-model="selvalue" placeholder="请选择" size="small" slot="name">
<el-option v-for="item in seloptions" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
<el-input size="small" v-model="input" placeholder="请输入内容"></el-input>
</GLSearchItem>
</GLSearch>
</template>
<script>
import {GLSearch, GLSearchItem} from 'glsx-components'
// 全局引入一次css即可
import 'glsx-components/dist/glsx-components.css'
export default {
data() {
return {
//gl-search数据
input: '',
options: [
{
value: '选项1',
label: '黄金糕'
},
{
value: '选项2',
label: '双皮奶'
},
{
value: '选项3',
label: '蚵仔煎'
},
{
value: '选项4',
label: '龙须面'
},
{
value: '选项5',
label: '北京烤鸭'
}
],
value: '',
value1: [new Date(2000, 10, 10, 10, 10), new Date(2000, 10, 11, 10, 10)],
seloptions: [
{
value: '选项1',
label: '黄金糕'
},
{
value: '选项2',
label: '双皮奶'
},
{
value: '选项3',
label: '蚵仔煎北京烤鸭'
},
{
value: '选项4',
label: '龙须面北京烤鸭'
},
{
value: '选项5',
label: '北京烤鸭北京烤鸭'
}
],
selvalue: ''
}
},
methods: {
handleOkFn() {
console.log('您点击了确定')
},
handleRestFn() {
console.log('您点击了取消')
}
}
}
</script>
```
</div>
<!-- </content> -->
<template>
<div class="gl-search" id="gl-search" :class="{ transTo: !expand }">
<div class="search-list">
<!-- 默认插槽 -->
<slot></slot>
<!-- <div class="search-item">
<div class="name">我是文本输入框</div>
<div class="input">
<el-input
size="small"
v-model="input"
placeholder="请输入内容"
></el-input>
</div>
</div> -->
<!-- <div class="search-item">
<div class="name">我是文本输入框</div>
<div class="input">
<el-input
size="small"
v-model="input"
placeholder="请输入内容"
></el-input>
</div>
</div> -->
<!-- <div class="search-item">
<div class="name">我是文本输入框</div>
<div class="input">
<el-input
size="small"
v-model="input"
placeholder="请输入内容"
></el-input>
</div>
</div>
<div class="search-item">
<div class="name">我是文本输入框</div>
<div class="input">
<el-input
size="small"
v-model="input"
placeholder="请输入内容"
></el-input>
</div>
</div> -->
</div>
<div class="gl-operate">
<div class="operate">
<el-button size="small" type="primary" @click="handleOk">查询</el-button>
<el-button size="small" @click="handleRest">重置</el-button>
<el-button type="text" size="small" @click="expandFn" v-if="hasExpand">
<span>{{ !expand ? '展开' : '收起' }}</span>
<i class="expand" :class="classIcon"></i>
</el-button>
<!-- <i class="el-icon-arrow-down expand"></i> -->
<!-- <i class="el-icon-arrow-up"></i> -->
</div>
</div>
</div>
</template>
<script>
export default {
name: 'GLSearch',
props: {},
data() {
return {
// input: '',
expand: false,
itemNum: 0,
time: null,
hasExpand: false
}
},
created() {},
mounted() {
this.getItemNum()
// 判断宽度按,是否显示展开收起
this.getClientWith()
window.addEventListener('resize', this.getClientWith, false)
},
computed: {
classIcon() {
return !this.expand ? 'el-icon-arrow-down' : 'el-icon-arrow-up'
}
},
methods: {
// 展开收起
expandFn() {
this.expand = !this.expand
},
// 获取item 输入框 的个数
getItemNum() {
const items = document.getElementById('gl-search').getElementsByClassName('search-item').length
this.itemNum = items
},
// 判断是否有展开收起标志
ifHasExpand(nowCol) {
if (this.itemNum > nowCol) {
return true
}
return false
},
// 监听函数
getClientWith() {
if (this.time) clearTimeout(this.time)
this.time = setTimeout(() => {
const clientWidth = document.documentElement.clientWidth
// console.log('clientWidth: ', clientWidth)
if (clientWidth <= 800) {
// 1列
this.hasExpand = this.ifHasExpand(1)
} else if (clientWidth <= 1440 && clientWidth > 800) {
// 2列
this.hasExpand = this.ifHasExpand(2)
} else if (clientWidth <= 1720 && clientWidth > 1440) {
// 3列
this.hasExpand = this.ifHasExpand(3)
} else {
// 4列
this.hasExpand = this.ifHasExpand(4)
}
}, 300)
},
handleOk() {
// 点击确定的回调
this.$emit('onOk')
},
handleRest() {
// 点击重置的回调
this.$emit('onRest')
}
},
components: {},
watch: {},
beforeDestroy() {
window.removeEventListener('resize', this.getClientWith, false)
this.time = null
}
}
</script>
<style lang="scss">
.gl-search {
&.transTo {
height: 52px;
}
display: flex;
justify-content: space-between;
overflow: hidden;
// @media screen and (max-width: 1062px) {
// .search-list {
// .search-item {
// width: 100%;
// }
// }
// }
// @media screen and (min-width: 1062px) and (max-width: 1440px) {
// .search-list {
// .search-item {
// width: 100%;
// }
// }
// }
// @media screen and (min-width: 1440px) and (max-width: 1720px) {
// .search-list {
// .search-item {
// width: 100%;
// }
// }
// }
// @media screen and (min-width: 1720px) {
// .search-list {
// .search-item {
// width: 100%;
// }
// }
// }
.search-list {
.search-item {
width: 100%;
}
}
.search-list {
flex: 1;
display: flex;
flex-wrap: wrap;
.search-item {
// flex: 1;
// padding-right: 12px;
margin-bottom: 20px;
min-width: 276px;
display: flex;
align-items: center;
box-sizing: border-box;
.name {
width: 112px;
text-align: right;
font-size: 14px;
font-weight: 400;
color: #666;
}
.input {
flex: 1;
// width:100%;
}
.el-input {
width: 100%;
}
.el-select {
width: 100%;
}
.el-date-editor {
width: 100%;
}
}
}
.gl-operate {
display: flex;
align-items: flex-end;
.operate {
text-align: left;
width: 190px;
margin-bottom: 20px;
.expand {
font-size: 14px;
}
.el-button + .el-button {
margin-left: 8px;
}
}
}
}
</style>
import GLSearchItem from './src/index.vue'
// 为组件提供 install 安装方法,供按需引入
GLSearchItem.install = function(Vue) {
Vue.component(GLSearchItem.name, GLSearchItem)
}
// 默认导出组件
export default GLSearchItem
\ No newline at end of file \ No newline at end of file
<template>
<div :style="{ 'padding-right': spacer + 'px' }" class="search-item">
<div class="name">
<!-- {{ label }} -->
<!-- name 插槽 -->
<slot name="name"></slot>
</div>
<div class="input">
<!-- 默认插槽 -->
<slot></slot>
<!-- <el-input
size="small"
v-model="input"
placeholder="请输入内容"
></el-input> -->
</div>
</div>
</template>
<script>
export default {
name: 'GLSearchItem',
props: {
// 每个项间隙
spacer: {
type: Number,
default: 12
}
},
data () {
return {}
},
created () {},
mounted () {},
computed: {},
methods: {},
components: {},
watch: {}
}
</script>
<!--
* @Description:
* @Author: huyue
* @Date: 2022-05-24 18:18:53
* @LastEditors: huyue
* @LastEditTime: 2022-06-14 18:21:41
-->
<template>
<div>
<GLDialog title="人群筛选" :hasFooter="true" :visible.sync="crowdVisible" mode="big">
<div class="member-wrapper">
<div class="member-left">
<div class="member-title">
人群列表
</div>
<div class="member-content">
<el-form :inline="true" class="member-form" :model="searchForm" @submit.native.prevent>
<el-form-item label="人群名称" style="margin-bottom: 0" size="small">
<el-input :size="size" v-model.trim="searchForm.keyword" @keyup.enter.native="search" clearable placeholder="请输入关键字搜索"></el-input>
</el-form-item>
<el-form-item label style="margin-bottom: 0;margin-left:10px" size="small">
<el-button type="primary" :size="size" @click="search">搜索</el-button>
</el-form-item>
</el-form>
<div class="table-content">
<GLTable v-loading="loading" ref="crowdTable" :tableData="tableData" @refreshTable="getCrowdList" :tableTotal="tableTotal" :layout="layout" :tableParams="crowdTableParams" :hasNum="true" :pageConf="pageConf" :noDataImg="url" @selectionTable="handleSelectionTable" @row-click="rowClick"></GLTable>
</div>
</div>
</div>
<div class="member-right">
<div class="member-title">已选</div>
<div class="member-name">人群({{ innerTags.length }}项)</div>
<div class="input-tag-wrapper">
<div class="tag-box">
<el-tag v-for="(tag, idx) in innerTags" :key="idx" type="info" closable :disable-transitions="false" @close="remove(tag, idx)">
{{ tag.crowdName }}
</el-tag>
</div>
</div>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button style="width: 68px;" size="small" @click="crowdVisible = false">取 消</el-button>
<el-button style="width: 68px;" size="small" type="primary" @click.native="handleConfirm">确 定</el-button>
</span>
</GLDialog>
</div>
</template>
<script>
// import url from '@/assets/empty.png'
export default {
name: 'SelectCrowd',
data() {
return {
url: 0,
crowdVisible: false,
searchForm: { keyword: '' },
innerTags: [],
inner: [],
tableCrowdData: [
{
name: 'asda'
}
],
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
layout: 'sizes, prev, pager, next, jumper, ->, total',
tableData: [],
tableTotal: 0,
crowdTableParams: {
checkSelectKey: 'id',
checkSelectVal: [],
hasNum: false,
listName: 'crowdUnitList',
// 行数据的key
mutiSelectUniqueKey: 'crowdId',
// 多选ref的名称
mutiSelectName: 'crowdlist',
tableColumns: [
{
label: '人群名称',
prop: 'crowdName'
},
{
label: '人群描述',
prop: 'crowdDesc',
width: '200',
line: 1
},
{
label: '人数',
prop: 'total'
}
]
}
}
},
methods: {
init(val) {
this.inner = this.$common.utils.deepClone(val)
this.innerTags = this.$common.utils.deepClone(val)
this.crowdVisible = true
this.searchForm.keyword = ''
this.$nextTick(() => {
this.$refs.crowdTable.$refs.crowdlistMutiTable.clearSelection()
this.$refs.crowdTable.page.pageNum = 1
this.getCrowdList()
})
},
// this.$refs.crowdTable.tableHeightValues = '250'
getCrowdList(page = { pageNum: 1, pageSize: 10 }) {
this.$refs.crowdTable.page = page
var params = {
req: {
keyword: this.searchForm.keyword,
merchantId: this.$globalState.session.merchantId,
crowdType: 3,
filterType: 2,
pageSize: page.pageSize,
pageNum: page.pageNum
}
}
this.$apis.channel.queryCrowdtree(params).then(res => {
this.tableData = res.crowdUnitList
this.tableTotal = res.total
// console.log(this.inner)
// console.log(this.tableData)
// this.tableData.forEach(item => {
// this.inner.forEach((itm, index) => {
// if (itm.crowdId == item.crowdId) {
// this.rowClick(item)
// }
// })
// })
this.recoverySelected()
})
},
// selectionTable(val) {
// this.innerTags = []
// for (let i = 0; i < val.length; i++) {
// const tagArr = this.innerTags.map(item => item.crowdId + '')
// console.log(tagArr)
// if (!tagArr.includes(val[i].crowdId)) {
// this.innerTags.push(val[i])
// }
// console.log(this.innerTags)
// }
// },
// 选择/取消
handleSelectionTable(val) {
var list = JSON.parse(JSON.stringify(this.innerTags))
this.innerTags = []
val.forEach(item => {
if (this.innerTags.findIndex(k => k.crowdId == item.crowdId) == '-1') {
this.innerTags.push(item)
}
})
list.forEach(item => {
if (this.tableData.findIndex(k => k.crowdId == item.crowdId) == '-1' && this.innerTags.findIndex(k => k.crowdId == item.crowdId) == '-1') {
this.innerTags.push(item)
}
})
},
// 恢复选择
addSelected() {
this.$nextTick(() => {
var list = JSON.parse(JSON.stringify(this.innerTags))
if (list && list.length) {
list.forEach(row => {
var idx = this.tableData.findIndex(k => k.crowdId == row.crowdId)
if (idx != -1) {
this.$refs.crowdTable.$refs.crowdlistMutiTable.toggleRowSelection(this.tableData[idx], true)
}
})
}
})
},
recoverySelected() {
// 翻页,去掉已选项
var selectedData = this.$refs.crowdTable.mutiSelectArr.crowdlist
var deleteList = []
this.addSelected()
if (selectedData) {
selectedData.forEach(item => {
if (this.innerTags.findIndex(subItem => subItem.crowdId == item.crowdId) == -1) {
deleteList.push(item)
}
})
this.deleteSelected(deleteList)
}
},
// 删除选中
deleteSelected(deleteList) {
this.$nextTick(() => {
deleteList.forEach(row => {
var idx = this.tableData.findIndex(k => k.crowdId == row.crowdId)
if (idx != -1) {
this.$refs.crowdTable.$refs.crowdlistMutiTable.toggleRowSelection(this.tableData[idx], false)
}
})
})
},
remove(item) {
var idx = this.innerTags.findIndex(k => k.crowdId == item.crowdId)
this.innerTags.splice(idx, 1)
if (this.tableData.map(k => k.crowdId).includes(item.crowdId)) {
var i = this.tableData.findIndex(k => k.crowdId == item.crowdId)
this.$refs.crowdTable.$refs.crowdlistMutiTable.toggleRowSelection(this.tableData[i])
}
},
rowClick(row) {
this.$refs.crowdTable.$refs.crowdlistMutiTable.toggleRowSelection(row)
},
search() {
this.getCrowdList({ pageNum: 1, pageSize: 10 })
},
handleConfirm() {
// console.log(this.innerTags)
this.$emit('crowdData', this.innerTags)
this.crowdVisible = false
this.searchForm = { keyword: {} }
}
}
}
</script>
<style lang="scss" scoped>
.member-wrapper {
display: flex;
.member-title {
font-size: 16px;
color: #333;
font-weight: 500;
line-height: 22px;
margin-bottom: 6px;
span {
display: inline-block;
padding-left: 5px;
font-size: 12px;
color: #999;
font-weight: 500;
}
}
.member-left {
width: 800px;
.member-content {
border: 1px solid #eee;
padding-bottom: 20px;
/deep/ {
.el-table {
// height: 40vh;
overflow-y: auto;
}
}
.member-form {
padding: 10px 20px;
}
.table-content {
max-height: 500px;
overflow: auto;
border-top: 1px solid #eee;
}
}
.member-checked {
text-align: right;
margin-top: 10px;
}
}
.member-right {
width: 286px;
margin-left: 14px;
.member-name {
font-size: 14px;
color: #333;
line-height: 20px;
padding: 18px;
border: 1px solid #eee;
}
}
}
.tag-box {
height: 100%;
width: 100%;
}
.input-tag-wrapper {
position: relative;
font-size: 14px;
border: 1px solid #eee;
border-top: none;
box-sizing: border-box;
color: #606266;
display: inline-block;
padding: 8px 10px;
line-height: 32px;
transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
width: 100%;
height: calc(100% - 86px);
display: flex;
align-items: center;
max-height: 500px;
overflow: auto;
// margin-bottom: 10px;
i {
color: #75acff;
margin-right: 3px;
font-size: 14px;
}
/deep/ input {
/* input { */
/* background-color: red!important; 调试用的样式 */
outline: none !important;
border: none !important;
}
/deep/ .el-input {
min-width: 150px;
width: auto;
flex: 1;
}
}
.el-tag {
margin-right: 10px;
line-height: 22px;
margin-bottom: 5px;
height: 24px;
background: #fafbfe !important;
}
/deep/ {
.el-dialog__title {
font-weight: 600;
}
.el-dialog__header {
padding: 20px;
}
.el-dialog__headerbtn {
height: 30px;
.el-dialog__close {
width: 24px;
height: 24px;
}
}
.el-pagination {
padding-left: 20px;
border-top: 1px solid #e8e8ea;
padding-top: 16px;
}
.el-table:before {
display: none;
}
}
</style>
<template> <template>
<div class="square-main" v-loading="loading"> <div class="square-main" v-loading="loading">
<el-dialog title="选择跟进专员" :visible.sync="dialogVisible" width="50%" :before-close="handleClose"> <GLDialog title="选择跟进专员" :hasFooter="true" :visible.sync="dialogVisible">
<el-form :inline="true" :model="tableSearchForm"> <el-form :inline="true" :model="tableSearchForm">
<el-form-item size="small" label="员工"> <el-form-item size="small" label="员工">
<el-input v-model="tableSearchForm.staffName" placeholder="请输入员工姓名"></el-input> <el-input v-model="tableSearchForm.staffName" placeholder="请输入员工姓名"></el-input>
</el-form-item> </el-form-item>
<el-form-item size="small"> <el-form-item size="small" class="emp-form-btn">
<el-button type="primary" @click="handleSearch">查询</el-button> <el-button type="primary" @click="handleSearch">查询</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
...@@ -15,12 +15,13 @@ ...@@ -15,12 +15,13 @@
<el-button size="small" @click="handleCancel">取 消</el-button> <el-button size="small" @click="handleCancel">取 消</el-button>
<el-button size="small" type="primary" @click.native="handleSelect">确 定</el-button> <el-button size="small" type="primary" @click.native="handleSelect">确 定</el-button>
</span> </span>
</el-dialog> </GLDialog>
</div> </div>
</template> </template>
<script> <script>
import { utils } from 'glsx-common' import { utils } from 'glsx-common'
import util from '@/utils/util' import util from '@/utils/util'
export default { export default {
name: 'selectEmp', name: 'selectEmp',
...@@ -61,7 +62,7 @@ export default { ...@@ -61,7 +62,7 @@ export default {
}, },
methods: { methods: {
jumpUrl() { jumpUrl() {
util.openUrl(location.origin + '/home/followUp/index') util.openUrl(location.origin + '/settings/followUp/index')
}, },
getFollower() { getFollower() {
var params = { var params = {
...@@ -100,11 +101,11 @@ export default { ...@@ -100,11 +101,11 @@ export default {
handleClose() { handleClose() {
this.handleCancel() this.handleCancel()
}, },
handleCancel: utils.debounce(function () { handleCancel: utils.debounce(function() {
this.dialogVisible = false this.dialogVisible = false
this.$refs.table.$refs.salelistMutiTable.clearSelection() this.$refs.table.$refs.salelistMutiTable.clearSelection()
}, 300), }, 300),
handleSelect: utils.debounce(function () { handleSelect: utils.debounce(function() {
this.loading = true this.loading = true
let selectEmp = this.selectEmp.map(item => { let selectEmp = this.selectEmp.map(item => {
return { return {
...@@ -124,11 +125,14 @@ export default { ...@@ -124,11 +125,14 @@ export default {
}, 300) }, 300)
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.emp-form-btn {
margin-left: 20px;
}
.dialog-jump { .dialog-jump {
color: #5850FF; color: #5850ff;
float: left; float: left;
line-height: 24px; line-height: 24px;
text-decoration: underline; text-decoration: underline;
...@@ -148,4 +152,4 @@ export default { ...@@ -148,4 +152,4 @@ export default {
} }
} }
} }
</style>
\ No newline at end of file \ No newline at end of file
</style>
<template> <template>
<div class="tag-main"> <div class="tag-main">
<el-dialog title="选择标签" :visible.sync="dialogVisible" width="70%" :before-close="handleClose"> <GLDialog bigTitle="选择标签" :hasFooter="true" :visible.sync="dialogVisible" mode="big">
<div class="tag-panel"> <div class="tag-panel">
<div class="tag-panel-select"> <div class="tag-panel-select">
<div class="tag-title">预选标签</div> <div class="tag-title">预选标签</div>
...@@ -9,12 +9,12 @@ ...@@ -9,12 +9,12 @@
<el-input size="small" v-model="labelGroupName" placeholder="请输入搜索内容"></el-input> <el-input size="small" v-model="labelGroupName" placeholder="请输入搜索内容"></el-input>
<el-button size="small" type="primary" @click="handleSearch">查询</el-button> <el-button size="small" type="primary" @click="handleSearch">查询</el-button>
</div> </div>
<div class="checkbox-group-box" :style="{ height: heightBox + 'px' }"> <div class="checkbox-group-box" :style="{ height: heightBox + 'px' }" v-loading="loading">
<div style="margin-bottom: 8px" v-for="(item, index) in labelTreeRets" :key="index"> <div style="margin-bottom: 8px" v-for="(item, index) in labelTreeRets" :key="index">
<span class="el-tree-node__expand-icon el-icon-caret-right" :class="{ expanded: item.checked }" @click="item.checked = !item.checked"></span> <span class="el-tree-node__expand-icon el-icon-caret-right" :class="{ expanded: item.checked }" @click.self="item.checked = !item.checked"></span>
<el-checkbox :indeterminate="item.isIndeterminate" v-model="item.checkAll" @change="handleCheckAllChange(item.checkAll, index)">{{ item.labelGroup.name }}({{ item.tagChecked.length }}/{{ item.labelList.length }} 项)</el-checkbox> <el-checkbox :indeterminate="item.isIndeterminate" v-model="item.checkAll" @change="handleCheckAllChange(item.checkAll, index)">{{ item.labelGroup.name }}({{ item.tagChecked.length }}/{{ item.labelList.length }} 项)</el-checkbox>
<div style="margin: 15px 0"></div> <div style="margin: 15px 0"></div>
<el-checkbox-group class="tag-group" v-model="item.tagChecked" @change="handleCheckedChange(item.tagChecked, index)" v-show="item.checked"> <el-checkbox-group class="tag-group" v-model="item.tagChecked" @change="handleCheckedChange(item.tagChecked, index)" v-if="item.checked">
<el-checkbox v-for="(itm, idx) in item.labelList" :label="itm" :key="idx">{{ itm.name }}</el-checkbox> <el-checkbox v-for="(itm, idx) in item.labelList" :label="itm" :key="idx">{{ itm.name }}</el-checkbox>
</el-checkbox-group> </el-checkbox-group>
</div> </div>
...@@ -39,10 +39,12 @@ ...@@ -39,10 +39,12 @@
</div> </div>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<a class="dialog-jump" @click="jumpUrl" v-if="this.$globalState.session.accountLevel == 4 && this.$globalState.session.merchantModel == 2">没有意向标签?点我创建</a> <a class="dialog-jump" @click="jumpUrl" v-if="this.$globalState.session.accountLevel == 4 && this.$globalState.session.merchantModel == 2">没有意向标签?点我创建</a>
<el-button size="small" @click="dialogVisible = false">取 消</el-button> <el-button size="small" @click="handleClose">
取 消
</el-button>
<el-button size="small" type="primary" @click="handleSelect">确 定</el-button> <el-button size="small" type="primary" @click="handleSelect">确 定</el-button>
</span> </span>
</el-dialog> </GLDialog>
</div> </div>
</template> </template>
...@@ -53,38 +55,14 @@ export default { ...@@ -53,38 +55,14 @@ export default {
name: 'activityModel', name: 'activityModel',
data() { data() {
return { return {
loading: false,
heightBox: 200, heightBox: 200,
dialogVisible: false, dialogVisible: false,
labelGroupName: '', labelGroupName: '',
selectNum: 0, selectNum: 0,
searchStatus: false, searchStatus: false,
labelTreeRetSelect: [], labelTreeRetSelect: [],
labelTreeRets: [ labelTreeRets: []
{
labelGroup: { id: '109', name: '湖口123' },
labelList: [
{ id: '372', name: '12345678' },
{ id: '371', name: '7654321' },
{ id: '370', name: '1234567' }
],
checked: false,
tagChecked: [],
isIndeterminate: false,
checkAll: false
},
{
labelGroup: { id: '65', name: '自店标签111' },
labelList: [
{ id: '179', name: '标签44' },
{ id: '178', name: '标签33' },
{ id: '176', name: '标签1112' }
],
checked: false,
tagChecked: [],
isIndeterminate: false,
checkAll: false
}
]
} }
}, },
watch: { watch: {
...@@ -113,6 +91,7 @@ export default { ...@@ -113,6 +91,7 @@ export default {
this.querylabeltree() this.querylabeltree()
}, },
querylabeltree(selectItem) { querylabeltree(selectItem) {
this.loading = true
this.$apis.channel this.$apis.channel
.querylabeltree({ .querylabeltree({
labelTreeReq: { labelTreeReq: {
...@@ -150,19 +129,14 @@ export default { ...@@ -150,19 +129,14 @@ export default {
} }
}) })
}) })
this.labelTreeRets.forEach(item => {
this.labelTreeRetSelect.forEach(itm => {
if (itm.labelGroup.id == item.labelGroup.id) {
item.tagChecked = utils.deepClone(itm.tagChecked)
}
})
})
this.labelTreeRets.forEach((item, index) => { this.labelTreeRets.forEach((item, index) => {
this.$nextTick(() => { this.$nextTick(() => {
this.handleCheckedChange(item.tagChecked, index) this.handleCheckedChange(item.tagChecked, index, 1)
}) })
}) })
this.labelTreeRetSelect = utils.deepClone(this.labelTreeRets) this.$nextTick(() => {
this.labelTreeRetSelect = utils.deepClone(this.labelTreeRets)
})
} else { } else {
this.labelTreeRets = res.labelTreeRets.map(item => { this.labelTreeRets = res.labelTreeRets.map(item => {
return { return {
...@@ -194,14 +168,27 @@ export default { ...@@ -194,14 +168,27 @@ export default {
this.labelTreeRetSelect = utils.deepClone(this.labelTreeRets) this.labelTreeRetSelect = utils.deepClone(this.labelTreeRets)
} }
} }
this.$nextTick(() => {
this.loading = false
})
}) })
}, },
remove(item, idx) { handleClose() {
item.tagChecked.splice(idx, 1) this.labelTreeRetSelect = []
this.dialogVisible = false
},
remove(items, idx) {
items.tagChecked.splice(idx, 1)
this.labelTreeRets.forEach(item => { this.labelTreeRets.forEach(item => {
this.labelTreeRetSelect.forEach(itm => { this.labelTreeRetSelect.forEach(itm => {
if (item.labelGroup.id == itm.labelGroup.id) { if (item.labelGroup.id == itm.labelGroup.id) {
item.tagChecked = utils.deepClone(itm.tagChecked) let tagChecked = []
itm.tagChecked.forEach(x => {
tagChecked.push(x.id)
})
this.$nextTick(() => {
item.tagChecked = item.labelList.filter(i => tagChecked.includes(i.id))
})
} }
if (item.tagChecked.length == 0) { if (item.tagChecked.length == 0) {
this.$nextTick(() => { this.$nextTick(() => {
...@@ -210,10 +197,9 @@ export default { ...@@ -210,10 +197,9 @@ export default {
} }
}) })
}) })
this.labelTreeRets.forEach((item, index) => { this.labelTreeRets.forEach((item, index) => {
this.$nextTick(() => { this.$nextTick(() => {
this.handleCheckedChange(item.tagChecked, index) this.handleCheckedChange(item.tagChecked, index, 1)
}) })
}) })
}, },
...@@ -273,7 +259,7 @@ export default { ...@@ -273,7 +259,7 @@ export default {
this.heightBox = clientHeight - 0.15 * clientHeight - 350 this.heightBox = clientHeight - 0.15 * clientHeight - 350
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.dialog-jump { .dialog-jump {
...@@ -370,4 +356,4 @@ export default { ...@@ -370,4 +356,4 @@ export default {
.tag-selected-box { .tag-selected-box {
min-height: 200px; min-height: 200px;
} }
</style>
\ No newline at end of file \ No newline at end of file
</style>
<template> <template>
<div class="square-main"> <div class="square-main">
<el-dialog title="选择活动" :visible.sync="dialogVisible" width="1088px" :before-close="handleClose"> <el-dialog title="选择活动" :visible.sync="dialogVisible" width="1088px" :before-close="handleClose">
<div class="model-panel"> <div class="model-panel" v-loading="loading">
<div class="model-panel-tab"> <div class="model-panel-tab">
<label>活动类型:</label> <label>活动类型:</label>
<el-tabs v-model="activeName" @tab-click="handleClick" type="card"> <el-tabs v-model="activeName" @tab-click="handleClick" type="card">
...@@ -9,10 +9,10 @@ ...@@ -9,10 +9,10 @@
<el-tab-pane label="权益套餐" name="4"></el-tab-pane> <el-tab-pane label="权益套餐" name="4"></el-tab-pane>
<el-tab-pane label="商城券" name="2"></el-tab-pane> <el-tab-pane label="商城券" name="2"></el-tab-pane>
<el-tab-pane label="秒杀活动" name="5"></el-tab-pane> <el-tab-pane label="秒杀活动" name="5"></el-tab-pane>
<!-- <el-tab-pane label="无忧服务" name="6" v-if="openFlag"></el-tab-pane> --> <el-tab-pane label="无忧服务" name="6" v-if="openFlag"></el-tab-pane>
</el-tabs> </el-tabs>
</div> </div>
<div class="model-item-panel" v-if="modelList.length > 0" v-loading="loading"> <div class="model-item-panel" v-if="modelList.length > 0">
<div class="model-item" :class="{ checked: selectItem == item }" v-for="(item, index) in modelList" :key="index" @click="handleSelectItem(item)"> <div class="model-item" :class="{ checked: selectItem == item }" v-for="(item, index) in modelList" :key="index" @click="handleSelectItem(item)">
<div class="model-item-title" :title="item.equityName" v-show="activeName == 3">{{ item.equityName }}</div> <div class="model-item-title" :title="item.equityName" v-show="activeName == 3">{{ item.equityName }}</div>
<div class="model-item-title" :title="item.couponName" v-show="activeName == 2">{{ item.couponName }}</div> <div class="model-item-title" :title="item.couponName" v-show="activeName == 2">{{ item.couponName }}</div>
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
</div> </div>
<div class="model-item-content model-item-weight" v-show="activeName == 6"> <div class="model-item-content model-item-weight" v-show="activeName == 6">
赠送天数: 赠送天数:
<span>{{ effectiveType == 2 ? item.effectiveDay + '天' : '永久有效' }}</span> <span>{{ item.effectiveType == 2 ? item.effectivedDay + '天' : '永久有效' }}</span>
</div> </div>
<div class="model-item-content" v-show="activeName == 4 || activeName == 5"></div> <div class="model-item-content" v-show="activeName == 4 || activeName == 5"></div>
<div class="model-item-content model-item-contents" v-show="activeName == 4"> <div class="model-item-content model-item-contents" v-show="activeName == 4">
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
<img src="@/assets/img/empty.png" /> <img src="@/assets/img/empty.png" />
<div class="empty-item">暂无数据</div> <div class="empty-item">暂无数据</div>
</div> </div>
<el-pagination v-if="activeName != 3" @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="pageNum" :page-sizes="[12, 24, 36, 48]" :page-size="pageSize" :total="tableTotal" layout="total, sizes, prev, pager, next, jumper"></el-pagination> <el-pagination v-if="activeName != 3 && activeName != 6" @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="pageNum" :page-sizes="[12, 24, 36, 48]" :page-size="pageSize" :total="tableTotal" layout="total, sizes, prev, pager, next, jumper"></el-pagination>
</div> </div>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button size="small" @click="dialogVisible = false">取 消</el-button> <el-button size="small" @click="dialogVisible = false">取 消</el-button>
...@@ -171,6 +171,7 @@ export default { ...@@ -171,6 +171,7 @@ export default {
} }
if (this.activeName == 2) { if (this.activeName == 2) {
params.discountTypes = [2, 3, 4] params.discountTypes = [2, 3, 4]
params.directionalFlag = 1 // 1所有人可用2定向礼包专用3关联优惠券
params.validType = 'valid' params.validType = 'valid'
} }
if (this.activeName == 5) { if (this.activeName == 5) {
...@@ -195,12 +196,16 @@ export default { ...@@ -195,12 +196,16 @@ export default {
}) })
}, },
merchantOpen() { merchantOpen() {
this.$apis.marketing.merchantOpen({ merchantId: this.$globalState.session.merchantId }).then(res => { let channel = null
if (location.host == 'scrm.cgacar.com') {
channel = 2
}
this.$apis.marketing.merchantOpen({ merchantId: this.$globalState.session.merchantId, channel }).then(res => {
this.openFlag = res.openFlag this.openFlag = res.openFlag
}) })
}, },
init() { init() {
// this.merchantOpen() this.merchantOpen()
this.couponMenu = false this.couponMenu = false
this.activityMenu = false this.activityMenu = false
this.memberMenu = false this.memberMenu = false
...@@ -233,7 +238,7 @@ export default { ...@@ -233,7 +238,7 @@ export default {
} }
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.square-main { .square-main {
...@@ -370,4 +375,4 @@ export default { ...@@ -370,4 +375,4 @@ export default {
} }
} }
} }
</style>
\ No newline at end of file \ No newline at end of file
</style>
...@@ -88,30 +88,6 @@ export default { ...@@ -88,30 +88,6 @@ export default {
document.removeEventListener('selectionchange', this.selectHandler) document.removeEventListener('selectionchange', this.selectHandler)
}, },
methods: { methods: {
textareaRange() {
var el = this.$refs.wTextareaContent
var range = document.createRange()
//返回用户当前的选区
var sel = el.document.parentWindow.getSelection()
//获取当前光标位置
var offset = sel.focusOffset
//div当前内容
var content = el.innerHTML //添加换行符\n
el.innerHTML = content.slice(0, offset) + '\n\n' + content.slice(offset) //设置光标为当前位置
range.setStart(el.childNodes[0], offset + 1)
//使得选区(光标)开始与结束位置重叠
range.collapse(true)
//移除现有其他的选区
sel.removeAllRanges()
//加入光标的选区
sel.addRange(range)
},
textareaKeydown(event) {
if (event.keyCode == 13) {
console.log(11111111)
this.textareaRange()
}
},
updateData(text) { updateData(text) {
this.$emit('input', text) this.$emit('input', text)
}, },
...@@ -134,6 +110,50 @@ export default { ...@@ -134,6 +110,50 @@ export default {
// 处理后需要调用 addTag() 或者 addLink() 将内容传回来 // 处理后需要调用 addTag() 或者 addLink() 将内容传回来
this.$emit('add', type) this.$emit('add', type)
}, },
textareaKeydown(event) {
if (event.keyCode == 13) {
this.insertHtml('<br>')
let nn = document.createElement('br')
document.querySelector('.w-textarea_input').appendChild(nn)
return false
}
},
/*换行*/
insertHtml(html) {
var sel, range
if (window.getSelection) {
// IE9 或 非IE浏览器
sel = window.getSelection()
if (sel.getRangeAt && sel.rangeCount) {
range = sel.getRangeAt(0)
range.deleteContents()
// Range.createContextualFragment() would be useful here but is
// non-standard and not supported in all browsers (IE9, for one)
var el = document.createElement('div')
el.innerHTML = html
var frag = document.createDocumentFragment(),
node,
lastNode
while ((node = el.firstChild)) {
lastNode = frag.appendChild(node)
}
range.insertNode(frag)
// Preserve the selection
if (lastNode) {
range = range.cloneRange()
range.setStartAfter(lastNode)
range.collapse(true)
sel.removeAllRanges()
sel.addRange(range)
}
}
} else if (document.selection && document.selection.type != 'Control') {
// IE < 9
document.selection.createRange().pasteHTML(html)
}
this.currentText = document.querySelector('.w-textarea_input').innerHTML
this.$emit('updateText', this.currentText)
},
addTag(text) { addTag(text) {
// 创建模版标签 // 创建模版标签
let node = document.createElement(this.tag) let node = document.createElement(this.tag)
...@@ -244,15 +264,18 @@ export default { ...@@ -244,15 +264,18 @@ export default {
} }
let htm = target.innerHTML let htm = target.innerHTML
const list = emoji.flat(Infinity) const list = emoji.flat(Infinity)
const cutImg = htm.replaceAll('<img src="https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/', '') const cutImg = htm
const replaceImg = cutImg.replace(/(\d){3}.png">/g, function (str) { .replace(/<img src="https:\/\/img01.glsx.com.cn\/weapp\/resource\/saas\/scrm\/emoji\//g, '')
.replace(/<wise.+?(?:<\/wise>)/g, '@昵称')
.replace(/<br>/g, '\n')
const replaceImg = cutImg.replace(/(\d){3}.png">/g, function(str) {
let s = list[parseInt(str.split('.')[0]) - 1] let s = list[parseInt(str.split('.')[0]) - 1]
return `[${s}]` return `[${s}]`
}) })
console.log(replaceImg)
let Textnode = document.createElement('div') let Textnode = document.createElement('div')
Textnode.innerHTML = replaceImg Textnode.innerHTML = replaceImg
this.currentText = Textnode.innerText.substring(0, 600) this.currentText = replaceImg.substring(0, 600)
console.log(this.currentText)
this.$emit('updateText', this.currentText) this.$emit('updateText', this.currentText)
}, },
placeCaretAtEnd(el) { placeCaretAtEnd(el) {
...@@ -278,14 +301,18 @@ export default { ...@@ -278,14 +301,18 @@ export default {
let htm = target.innerHTML let htm = target.innerHTML
console.log(htm) console.log(htm)
const list = emoji.flat(Infinity) const list = emoji.flat(Infinity)
const cutImg = htm.replaceAll('<img src="https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/', '') const cutImg = htm
const replaceImg = cutImg.replace(/(\d){3}.png">/g, function (str) { .replace(/<img src="https:\/\/img01.glsx.com.cn\/weapp\/resource\/saas\/scrm\/emoji\//g, '')
.replace(/<wise.+?(?:<\/wise>)/g, '@昵称')
.replace(/<br>/g, '\n')
const replaceImg = cutImg.replace(/(\d){3}.png">/g, function(str) {
let s = list[parseInt(str.split('.')[0]) - 1] let s = list[parseInt(str.split('.')[0]) - 1]
return `[${s}]` return `[${s}]`
}) })
let Textnode = document.createElement('div') let Textnode = document.createElement('div')
Textnode.innerHTML = replaceImg Textnode.innerHTML = replaceImg
this.currentText = Textnode.innerText.substring(0, 600) this.currentText = replaceImg.substring(0, 600)
console.log(this.currentText)
this.$emit('updateText', this.currentText) this.$emit('updateText', this.currentText)
}, },
handleDelete(e) { handleDelete(e) {
...@@ -319,8 +346,9 @@ export default { ...@@ -319,8 +346,9 @@ export default {
} }
}, },
getGuid() { getGuid() {
return 1
// 生成随机ID // 生成随机ID
return `r${new Date().getTime()}d${Math.ceil(Math.random() * 1000)}` // return `r${new Date().getTime()}d${Math.ceil(Math.random() * 1000)}`
}, },
selectHandler() { selectHandler() {
// 监听选定文本的变动 // 监听选定文本的变动
...@@ -443,4 +471,4 @@ $textColor: #666; ...@@ -443,4 +471,4 @@ $textColor: #666;
} }
} }
} }
</style>
\ No newline at end of file \ No newline at end of file
</style>
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
<span v-else>{{ item.name }}</span> <span v-else>{{ item.name }}</span>
<input v-if="item.type == 'img'" type="file" style="opacity: 0" :id="item.name + 'file'" ref="file" class="welcome-input upload-img" :accept="item.accept || 'image/png, image/jpeg, image/jpg'" @change="e => handleImgChange(e, item)" /> <input v-if="item.type == 'img'" type="file" style="opacity: 0" :id="item.name + 'file'" ref="file" class="welcome-input upload-img" :accept="item.accept || 'image/png, image/jpeg, image/jpg'" @change="e => handleImgChange(e, item)" />
<input v-else-if="item.type == 'video'" type="file" style="opacity: 0" :id="item.name + 'file'" ref="file" class="welcome-input" :accept="item.accept || 'video/*'" @change="e => handleVideoChange(e, item)" /> <input v-else-if="item.type == 'video'" type="file" style="opacity: 0" :id="item.name + 'file'" ref="file" class="welcome-input" :accept="item.accept || 'video/*'" @change="e => handleVideoChange(e, item)" />
<el-link v-else-if="item.type == 'nickname' || item.type == 'acivity'" style="opacity: 0" @click="handleFun(item.funName)">{{ item.name }}</el-link> <el-link v-else-if="item.type == 'nickname' || item.type == 'acivity' || item.type == 'material'" style="opacity: 0" @click="handleFun(item.funName)">{{ item.name }}</el-link>
</div> </div>
</div> </div>
</div> </div>
...@@ -63,6 +63,7 @@ ...@@ -63,6 +63,7 @@
</div> </div>
</div> </div>
<ActivityModel ref="activity" @selectActivity="selectActivity"></ActivityModel> <ActivityModel ref="activity" @selectActivity="selectActivity"></ActivityModel>
<!-- <material-model v-if="isMaterialVisible" :isMaterialVisible.sync="isMaterialVisible" @handleMaterialConfirm="handleMaterialConfirm" @handleMaterialClose="handleMaterialClose"></material-model> -->
</div> </div>
</template> </template>
<script> <script>
...@@ -77,6 +78,7 @@ const ATT_TYPE = { ...@@ -77,6 +78,7 @@ const ATT_TYPE = {
} }
import emoji from '@/utils/emo' import emoji from '@/utils/emo'
import ActivityModel from './activityModel' import ActivityModel from './activityModel'
// import materialModel from './materialModel'
import Emotion from './emotionWords' import Emotion from './emotionWords'
import wTextarea from './tag-textarea' import wTextarea from './tag-textarea'
import { utils } from 'glsx-common' import { utils } from 'glsx-common'
...@@ -84,6 +86,7 @@ export default { ...@@ -84,6 +86,7 @@ export default {
name: 'WelcomeWords', name: 'WelcomeWords',
components: { components: {
ActivityModel, ActivityModel,
// materialModel,
Emotion, Emotion,
wTextarea wTextarea
}, },
...@@ -92,6 +95,7 @@ export default { ...@@ -92,6 +95,7 @@ export default {
return { return {
loading: false, loading: false,
emotionStatus: false, emotionStatus: false,
isMaterialVisible: false,
btnList: [ btnList: [
{ {
id: 1, id: 1,
...@@ -113,6 +117,12 @@ export default { ...@@ -113,6 +117,12 @@ export default {
type: 'nickname', type: 'nickname',
funName: 'nickname' funName: 'nickname'
}, },
// {
// id: 5,
// name: '素材',
// type: 'material',
// funName: 'material'
// },
{ {
id: 4, id: 4,
name: '活动', name: '活动',
...@@ -229,11 +239,33 @@ export default { ...@@ -229,11 +239,33 @@ export default {
}) })
} }
}, },
// 素材
handleMaterialConfirm(val) {
console.log(val)
// additionalType 附加对象类型(1素材,2活动,3优惠券,4朋友券模板)
// objectType 对象类型(1朋友圈模板-单图文,2朋友圈模板-多图文,3朋友圈模板-文字+视频,4朋友圈模板-文字,5优惠券-商城券,6活动-权益卡使用,7活动-权益套餐,8活动-秒杀活动,10-素材)
this.editForm.object = JSON.parse(JSON.stringify(val))
this.editRule.eventContent[0].required = true
this.editForm.pushChannelType = ''
this.previewList = [
{
attContent: val,
additionalType: val.additionalType
}
]
this.handleMaterialClose()
},
handleMaterialClose() {
this.isMaterialVisible = !this.isMaterialVisible
},
handleFun(name) { handleFun(name) {
if (name == 'nickname') { if (name == 'nickname') {
this.$refs.textContent.addTag('@昵称') this.$refs.textContent.addTag('@昵称')
} else if (name == 'activity') { } else if (name == 'activity') {
this.$refs.activity.init() this.$refs.activity.init()
} else if (name == 'material') {
this.handleMaterialClose()
} }
}, },
close(index) { close(index) {
...@@ -241,6 +273,7 @@ export default { ...@@ -241,6 +273,7 @@ export default {
this.eventBus.$emit('update', this.previewList) this.eventBus.$emit('update', this.previewList)
}, },
textInput(val) { textInput(val) {
val = val.replace(/&nbsp;/g, '')
const hasText = this.previewList.some(item => item.attType == 1) const hasText = this.previewList.some(item => item.attType == 1)
if (hasText) { if (hasText) {
this.$set(this.previewList, 0, { this.$set(this.previewList, 0, {
...@@ -276,35 +309,7 @@ export default { ...@@ -276,35 +309,7 @@ export default {
} }
} }
}, },
insertHtmlAtCaret(html) { changeInput: utils.debounce(function() {
var sel, range, frag
if (window.getSelection) {
sel = window.getSelection()
if (sel.getRangeAt && sel.rangeCount) {
range = sel.getRangeAt(0)
range.deleteContents()
var el = document.createElement('span')
el.innerHTML = '<span contenteditable="false" class="nickname">@昵称<i class="el-icon-error"></i></span>'
// var el = document.createElement('div')
// el.innerHTML = html
frag = document.createDocumentFragment()
var node
var lastNode
while ((node = el.firstChild)) {
lastNode = frag.appendChild(node)
}
range.insertNode(frag)
if (lastNode) {
range = range.cloneRange()
range.setEndAfter(lastNode)
range.collapse(true)
sel.removeAllRanges()
sel.addRange(range)
}
}
}
},
changeInput: utils.debounce(function () {
console.log(document.getElementById('editor').childNodes) console.log(document.getElementById('editor').childNodes)
var allNodes = document.getElementById('editor').childNodes var allNodes = document.getElementById('editor').childNodes
var str = '' var str = ''
...@@ -323,8 +328,8 @@ export default { ...@@ -323,8 +328,8 @@ export default {
this.previewList = val this.previewList = val
this.eventBus.$emit('update', this.previewList) this.eventBus.$emit('update', this.previewList)
const obj = val.find(item => item.attType == 1) const obj = val.find(item => item.attType == 1)
let attContent = obj.attContent.replaceAll('[@昵称]', '<wise id="1">@昵称</wise>') let attContent = obj.attContent.replace(/\[@昵称\]/g, '<wise id="1" contenteditable="false">@昵称</wise>')
const htm = attContent.replace(/\[[\u4E00-\u9FA56]{1,4}]/gi, function (res) { const htm = attContent.replace(/\[[\u4E00-\u9FA56]{1,4}]/gi, function(res) {
let word = res.replace(/\[|\]/gi, '') let word = res.replace(/\[|\]/gi, '')
const list = emoji.flat(Infinity) const list = emoji.flat(Infinity)
let index = parseInt(list.indexOf(word)) + 1 let index = parseInt(list.indexOf(word)) + 1
......
...@@ -12,12 +12,31 @@ module.exports = { ...@@ -12,12 +12,31 @@ module.exports = {
response: { response: {
data_key: 'data', data_key: 'data',
message_key: 'message', message_key: 'message',
code_key: 'code', code_key: ['code', 'returnCode'],
code_success_value: '0', code_success_value: '0',
errId_logout_value: '21',
code_message_map: {} code_message_map: {}
}, },
request: { request: {
baseURL: 'http://192.168.1.254', baseURL: 'http://scrm.dev.glsx.com.cn',
// 设置超时时间
timeout: 180000,
// 携带凭证
withCredentials: true,
// 返回数据类型
responseType: 'json'
},
request_tag: {
baseURL: 'http://ismv.branch.glsx.com.cn',
// 设置超时时间
timeout: 180000,
// 携带凭证
withCredentials: true,
// 返回数据类型
responseType: 'json'
},
request_common: {
baseURL: 'https://qcdidicb.glsx.net:7060',
// 设置超时时间 // 设置超时时间
timeout: 180000, timeout: 180000,
// 携带凭证 // 携带凭证
...@@ -31,7 +50,13 @@ module.exports = { ...@@ -31,7 +50,13 @@ module.exports = {
format: 'json', format: 'json',
source: '' source: ''
}, },
sign_common: {
appKey: '48e5e13229b82c1b4e6e8c96151f0637',
v: '1.0.0',
format: 'json',
source: ''
},
secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b', secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b',
cdn: 'https://www.xxx.cn/static' cdn: 'https://www.xxx.cn/static'
} }
\ No newline at end of file \ No newline at end of file
...@@ -12,15 +12,16 @@ let cfg = require('./conf.js') ...@@ -12,15 +12,16 @@ let cfg = require('./conf.js')
import { Http } from 'glsx-common' import { Http } from 'glsx-common'
let timeout = 30000 //超时时间 let timeout = 30000 //超时时间
export const fetchConfig = function(isEnv = true) { export const fetchConfig = function(isEnv = true) {
// if (isEnv) { if (isEnv) {
// let { request } = cfg let { request } = cfg
// Object.assign(request, { timeout }) Object.assign(request, { timeout })
// return Promise.resolve(cfg) return Promise.resolve(cfg)
// } }
return new Http({request: { timeout: 100000}}).get(' https://oss-config.test.glsx.com.cn/mock/618a32851072f92988f05a17/drainage/config') return new Http({ request: { timeout: 100000 } }).get('https://oss-config.test.glsx.com.cn/mock/618a32851072f92988f05a17/drainage/config')
// return new Http({ request: { timeout: 100000 } }).get('https://oss-config.dev.glsx.com.cn/mock/618a32851072f92988f05a17/drainage/config')
} }
export const config = { export const config = {
install(vue, cfg) {
vue.prototype.$config = cfg
}
}
\ No newline at end of file \ No newline at end of file
install(vue, cfg) {
vue.prototype.$config = cfg
}
}
...@@ -11,13 +11,17 @@ import Vue from 'vue' ...@@ -11,13 +11,17 @@ import Vue from 'vue'
import apis from './api' import apis from './api'
import './public-path' import './public-path'
import './components' import './components'
import filters from './utils/filters'
// import 'glsx-components/dist/glsx-components.css' // import 'glsx-components/dist/glsx-components.css'
import { start } from '@/setup' import { start } from '@/setup'
Vue.config.productionTip = false Vue.config.productionTip = false
Vue.prototype.$apis = apis Vue.prototype.$apis = apis
//过滤器统一处理预加载
Object.keys(filters).forEach(key => {
Vue.filter(key, filters[key])
})
start() start()
export { bootstrap, mount, unmount } export { bootstrap, mount, unmount } from '@/setup'
from '@/setup'
export const http = params => Vue.prototype.$http(params) export const http = params => Vue.prototype.$http(params)
export const http_common = params => Vue.prototype.$http_common(params) export const http_common = params => Vue.prototype.$http_common(params)
export const http_tag = params => Vue.prototype.$http_tag(params)
\ No newline at end of file \ No newline at end of file
export const http_tag = params => Vue.prototype.$http_tag(params)
const ATT_TYPE = {
TEXT: 1,
IMAGE: 2,
VEDIO: 3,
URL: 4,
MINIPROGRAM: 5,
FILE: 6,
ACTIVITY: 7,
MATERIAL: 10
}
export default {
data() {
return {
btnList: [
{
name: '表情',
funcName: '',
type: 'expression',
limitSize: 10
},
{
name: '图片',
funcName: '',
type: 'img',
// togetherItem: [ATT_TYPE.TEXT], //只允许文本和图片
// limitSize: 10, //限制图片大小
// limitNum: 2, //限制图片数量
// limitWidth: 10000, //限制单张图片宽度
// limitHeight: 10000,//限制单张图片高度
// Isdraggable: true, //图片拖拽
uploadApi: this.$apis.common.pictureUpload
},
{
name: '昵称',
type: 'nickname',
funName: 'nickname'
},
{
name: '活动',
type: 'activity',
funName: 'activity',
funParams: [
{
itemName: '权益卡试用',
itemValue: 3,
itemType: 'card',
getInterfaceApi: this.$apis.welcomeword.getCard,
params: {
tryAble: 1,
merchantId: this.$globalState.session.merchantId
}
},
{
itemName: '权益套餐',
itemValue: 4,
itemType: 'package',
getInterfaceApi: this.$apis.welcomeword.getPackage,
params: {}
},
{
itemName: '商城券',
itemValue: 2,
itemType: 'coupon',
getInterfaceApi: this.$apis.welcomeword.getMerchant,
params: {
discountTypes: [2, 3, 4],
directionalFlag: 1, // 1所有人可用2定向礼包专用3关联优惠券
validType: 'valid'
}
},
{
itemName: '秒杀活动',
itemValue: 5,
itemType: 'activity',
getInterfaceApi: this.$apis.welcomeword.getActivity,
params: {
activityStatus: 2,
currentPage: 1
}
},
{
itemName: '无忧服务',
itemValue: 6,
itemType: 'merchant',
getInterfaceApi: this.$apis.welcomeword.merchant,
merchantOpen: {
merchantOpenApi: this.$apis.welcomeword.merchantOpen,
params: {
merchantId: this.$globalState.session.merchantId
}
},
params: {
merchantId: this.$globalState.session.merchantId
}
}
]
},
{
name: '素材',
type: 'material',
funName: 'material',
groupListApi: this.$apis.welcomeword.getGroupListApi,
materialListApi: this.$apis.welcomeword.getMaterialListApi
//videoNo: true
// pdfNo: true
}
]
}
}
}
const staticRoutes = Object.freeze([{ const staticRoutes = Object.freeze([
{
name: 'channel', name: 'channel',
path: '/channel/index', path: '/channel/index',
component: resolve => require([`@/views/channel/index.vue`], resolve), component: resolve => require([`@/views/channel/index.vue`], resolve),
meta: {}, meta: {}
}, { },
{
name: 'channel', name: 'channel',
path: '/channel/store/:id/:codeUuid/:codeState', path: '/channel/store/:id/:codeUuid/:codeState',
component: resolve => require([`@/views/channel/store.vue`], resolve), component: resolve => require([`@/views/channel/store.vue`], resolve),
meta: {} meta: {}
}, { },
{
name: 'addCode', name: 'addCode',
path: '/channel/addCode/:id/:codeUuid', path: '/channel/addCode/:id/:codeUuid',
component: resolve => require([`@/views/channel/addCode.vue`], resolve), component: resolve => require([`@/views/channel/addCode.vue`], resolve),
meta: {} meta: {}
}, { },
{
name: 'poster', name: 'poster',
path: '/channel/poster/:id', path: '/channel/poster/:id',
component: resolve => require([`@/views/channel/poster.vue`], resolve), component: resolve => require([`@/views/channel/poster.vue`], resolve),
meta: {} meta: {}
}, { },
{
name: 'square', name: 'square',
path: '/square/index', path: '/square/index',
component: resolve => require([`@/views/square/index.vue`], resolve), component: resolve => require([`@/views/square/index.vue`], resolve),
meta: {} meta: {}
}, { },
{
name: 'import', name: 'import',
path: '/square/import', path: '/square/import',
component: resolve => require([`@/views/square/import.vue`], resolve), component: resolve => require([`@/views/square/import.vue`], resolve),
meta: {} meta: {}
}, { },
{
name: 'customDetail', name: 'customDetail',
path: '/square/customDetail', path: '/square/customDetail',
component: resolve => require([`@/views/square/customDetail.vue`], resolve), component: resolve => require([`@/views/square/customDetail.vue`], resolve),
meta: {} meta: {}
}, { },
{
name: 'importResult', name: 'importResult',
path: '/square/importResult/:id', path: '/square/importResult/:id',
component: resolve => require([`@/views/square/importResult.vue`], resolve), component: resolve => require([`@/views/square/importResult.vue`], resolve),
meta: {} meta: {}
}, { },
{
name: 'drainage', name: 'drainage',
path: '/square/drainage', path: '/square/drainage',
component: resolve => require([`@/views/square/drainage.vue`], resolve), component: resolve => require([`@/views/square/drainage.vue`], resolve),
meta: {} meta: {}
}, { },
{
name: 'market', name: 'market',
path: '/market/index', path: '/market/index',
component: resolve => require([`@/views/market/index.vue`], resolve), component: resolve => require([`@/views/market/index.vue`], resolve),
meta: {} meta: {}
}, { },
{
name: 'config', name: 'config',
path: '/market/config', path: '/market/config',
component: resolve => require([`@/views/market/config.vue`], resolve), component: resolve => require([`@/views/market/config.vue`], resolve),
meta: {} meta: {}
}, { },
{
name: 'configDetail', name: 'configDetail',
path: '/market/configDetail/:id?', path: '/market/configDetail/:id?',
component: resolve => require([`@/views/market/configDetail.vue`], resolve), component: resolve => require([`@/views/market/configDetail.vue`], resolve),
meta: {} meta: {}
}, { },
{
name: 'effect', name: 'effect',
path: '/market/effect/:id?', path: '/market/effect/:id?',
component: resolve => require([`@/views/market/effect.vue`], resolve), component: resolve => require([`@/views/market/effect.vue`], resolve),
meta: {} meta: {}
}, { },
{
name: 'overview', name: 'overview',
path: '/overview/index', path: '/overview/index',
component: resolve => require([`@/views/overview/index.vue`], resolve), component: resolve => require([`@/views/overview/index.vue`], resolve),
meta: {} meta: {}
}, { },
{
name: 'friends', name: 'friends',
path: '/friends/index/:id', path: '/friends/index/:id',
component: resolve => require([`@/views/friends/index.vue`], resolve), component: resolve => require([`@/views/friends/index.vue`], resolve),
meta: { permissions: ['新增'] } meta: { permissions: ['新增'] }
}])
export default staticRoutes
\ No newline at end of file \ No newline at end of file
}
])
export default staticRoutes
...@@ -2,14 +2,18 @@ import Vue from 'vue' ...@@ -2,14 +2,18 @@ import Vue from 'vue'
// import { message } from '@/plugins/element.js' // import { message } from '@/plugins/element.js'
import { fetchConfig } from '@/config' import { fetchConfig } from '@/config'
import ElementUI from 'element-ui' import ElementUI from 'element-ui'
import { GLTable, GLButton, GLFooter } from 'glsx-components' //权限按钮 (根据权限动态创建) import { GLTable, GLButton, GLFooter, GLCombiForm, GLDialog, GLFull } from 'glsx-components' //权限按钮 (根据权限动态创建)
import GLEditor from 'glsx-components/src/packages/Editor' //权限按钮 (根据权限动态创建)
import { getRoutes } from '@/router' import { getRoutes } from '@/router'
import render from './render' import render from './render'
Vue.use(ElementUI) Vue.use(ElementUI)
Vue.use(GLTable) Vue.use(GLTable)
Vue.use(GLFooter) Vue.use(GLFooter)
Vue.use(GLCombiForm)
Vue.use(GLDialog)
Vue.use(GLFull)
// import GLTable from '@/components/glsx-table/index' // import GLTable from '@/components/glsx-table/index'
// Vue.component('GLTable', GLTable) Vue.component('GLEditor', GLEditor)
// import 'glsx-components/src/theme/theme.scss' // import 'glsx-components/src/theme/theme.scss'
import 'glsx-components/dist/glsx-components.css' import 'glsx-components/dist/glsx-components.css'
import '@/assets/css/common.scss' import '@/assets/css/common.scss'
...@@ -17,35 +21,35 @@ let routes = [] ...@@ -17,35 +21,35 @@ let routes = []
let router = null let router = null
let instance = null let instance = null
export async function bootstrap({ name, id, history, common, messenger, globalState, routerBase }) { export async function bootstrap({ name, id, history, common, messenger, globalState, routerBase }) {
const { response, request, sign, secret, request_common, sign_common, request_tag } = await fetchConfig() const { response, request, sign, secret, request_common, sign_common, request_tag } = await fetchConfig(false)
Vue.prototype.$history = history Vue.prototype.$history = history
Vue.prototype.$messenger = messenger Vue.prototype.$messenger = messenger
Vue.prototype.$globalState = globalState Vue.prototype.$globalState = globalState
Vue.prototype.$common = common Vue.prototype.$common = common
Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: ElementUI.Message.error, headers: { token: globalState.session.token } }) Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: ElementUI.Message.error, headers: { token: globalState.session.token } })
Vue.prototype.$http_tag = new common.Http({ response, request: request_tag, sign, secret, alert: ElementUI.Message.error, headers: { token: globalState.session.token } }) Vue.prototype.$http_tag = new common.Http({ response, request: request_tag, sign, secret, alert: ElementUI.Message.error, headers: { token: globalState.session.token } })
Vue.prototype.$http_common = new common.Http({ response, signWay: "md5", request: request_common, sign: sign_common, secret, alert: ElementUI.Message.error, headers: { TGT: globalState.session.token } }) Vue.prototype.$http_common = new common.Http({ response, signWay: 'md5', request: request_common, sign: sign_common, secret, alert: ElementUI.Message.error, headers: { TGT: globalState.session.token } })
const routesData = common.utils.deepClone(globalState.routers) const routesData = common.utils.deepClone(globalState.routers)
routes = getRoutes(routesData) routes = getRoutes(routesData)
subscribe({ messenger }) subscribe({ messenger })
Vue.use(GLButton, { routes, routerBase }) Vue.use(GLButton, { routes, routerBase })
} }
export async function mount(props) { export async function mount(props) {
console.log('11111', props) console.log('11111', props)
const insts = render(props.routerBase, routes) const insts = render(props.routerBase, routes)
router = insts.router router = insts.router
instance = insts.vm instance = insts.vm
} }
export async function unmount() { export async function unmount() {
instance.$destroy() instance.$destroy()
instance.$el.innerHTML = '' instance.$el.innerHTML = ''
instance = null instance = null
router = null router = null
} }
function subscribe({ messenger }) { function subscribe({ messenger }) {
messenger.subscribe(v => {
console.log(`监听到子应用${v.from}发来消息:`, v)
})
}
\ No newline at end of file \ No newline at end of file
messenger.subscribe(v => {
console.log(`监听到子应用${v.from}发来消息:`, v)
})
}
...@@ -12,19 +12,19 @@ import Vue from 'vue' ...@@ -12,19 +12,19 @@ import Vue from 'vue'
import store from '@/store' import store from '@/store'
import { VueRouter } from '@/router' import { VueRouter } from '@/router'
const render = (base, routes) => { const render = (base, routes) => {
const router = new VueRouter({ const router = new VueRouter({
base, base,
routes, routes,
mode: 'history' mode: 'history'
}) })
router.afterEach(() => { router.afterEach(() => {
document.querySelector("#app").scrollTop = 0; document.querySelector('#app').scrollTop = 0
}) })
const vm = new Vue({ const vm = new Vue({
router, router,
store, store,
render: h => h(App) render: h => h(App)
}).$mount('#app') }).$mount('#app')
return { router, vm } return { router, vm }
} }
export default render
\ No newline at end of file \ No newline at end of file
export default render
export default { export default {
namespaced: true, namespaced: true,
state: { state: {
importData: { importData: {},
uploadInfo: null
}
}, },
mutations: { mutations: {
SET_IMPORT(state, data) { SET_IMPORT(state, data) {
state.importData = data state.importData = data
}, },
SET_UPLOAD_INFO(state, data) {
state.uploadInfo = data
}
}, },
actions: { actions: {
setImport({ commit }, data) { setImport({ commit }, data) {
commit('SET_IMPORT', data) commit('SET_IMPORT', data)
}, },
setUploadInfo({ commit }, data) {
commit('SET_UPLOAD_INFO', data)
}
} }
} }
import { isFunction } from './fns' import { isFunction } from './fns'
export function matchesSelectorToParentElements (el, selector, baseNode) { export function matchesSelectorToParentElements(el, selector, baseNode) {
let node = el let node = el
const matchesSelectorFunc = [ const matchesSelectorFunc = ['matches', 'webkitMatchesSelector', 'mozMatchesSelector', 'msMatchesSelector', 'oMatchesSelector'].find(func => isFunction(node[func]))
'matches',
'webkitMatchesSelector',
'mozMatchesSelector',
'msMatchesSelector',
'oMatchesSelector'
].find(func => isFunction(node[func]))
if (!isFunction(node[matchesSelectorFunc])) return false if (!isFunction(node[matchesSelectorFunc])) return false
...@@ -22,16 +16,13 @@ export function matchesSelectorToParentElements (el, selector, baseNode) { ...@@ -22,16 +16,13 @@ export function matchesSelectorToParentElements (el, selector, baseNode) {
return false return false
} }
export function getComputedSize ($el) { export function getComputedSize($el) {
const style = window.getComputedStyle($el) const style = window.getComputedStyle($el)
return [ return [parseFloat(style.getPropertyValue('width'), 10), parseFloat(style.getPropertyValue('height'), 10)]
parseFloat(style.getPropertyValue('width'), 10),
parseFloat(style.getPropertyValue('height'), 10)
]
} }
export function addEvent (el, event, handler) { export function addEvent(el, event, handler) {
if (!el) { if (!el) {
return return
} }
...@@ -44,7 +35,7 @@ export function addEvent (el, event, handler) { ...@@ -44,7 +35,7 @@ export function addEvent (el, event, handler) {
} }
} }
export function removeEvent (el, event, handler) { export function removeEvent(el, event, handler) {
if (!el) { if (!el) {
return return
} }
......
const emoji = [ const emoji = [
['微笑', '撇嘴', '色', '发呆', '得意', '流泪', '害羞', '闭嘴'], ['微笑', '撇嘴', '色', '发呆', '得意', '流泪', '害羞', '闭嘴'],
['睡', '大哭', '尴尬', '发怒', '调皮', '呲牙', '惊讶', '难过'], ['睡', '大哭', '尴尬', '发怒', '调皮', '呲牙', '惊讶', '难过'],
['酷', '囧', '抓狂', '吐', '微笑', '愉快', '白眼', '傲慢'], ['酷', '囧', '抓狂', '吐', '微笑', '愉快', '白眼', '傲慢'],
['饥饿', '困', '惊恐', '流汗', '憨笑', '大兵', '奋斗', '咒骂'], ['饥饿', '困', '惊恐', '流汗', '憨笑', '大兵', '奋斗', '咒骂'],
['疑问', '嘘', '晕', '折磨', '衰', '骷髅', '敲打', '再见'], ['疑问', '嘘', '晕', '折磨', '衰', '骷髅', '敲打', '再见'],
['擦汗', '抠鼻', '鼓掌', '糗大了', '坏笑', '左哼哼', '右哼哼', '哈欠'], ['擦汗', '抠鼻', '鼓掌', '糗大了', '坏笑', '左哼哼', '右哼哼', '哈欠'],
['鄙视', '委屈', '快哭了', '阴险', '亲亲', '吓', '可怜', '菜刀'], ['鄙视', '委屈', '快哭了', '阴险', '亲亲', '吓', '可怜', '菜刀'],
['西瓜', '啤酒', '篮球', '乒乓', '咖啡', '饭', '猪头', '玫瑰'], ['西瓜', '啤酒', '篮球', '乒乓', '咖啡', '饭', '猪头', '玫瑰'],
['凋谢', '示爱', '爱心', '心碎', '蛋糕', '闪电', '炸弹', '刀'], ['凋谢', '示爱', '爱心', '心碎', '蛋糕', '闪电', '炸弹', '刀'],
['足球', '瓢虫', '便便', '月亮', '太阳', '礼物', '拥抱', '强'], ['足球', '瓢虫', '便便', '月亮', '太阳', '礼物', '拥抱', '强'],
['弱', '握手', '胜利', '抱拳', '勾引', '拳头', '差劲', '爱你'], ['弱', '握手', '胜利', '抱拳', '勾引', '拳头', '差劲', '爱你'],
['NO', 'OK', '爱情', '飞吻', '跳跳', '发抖', '怄火', '转圈'], ['NO', 'OK', '爱情', '飞吻', '跳跳', '发抖', '怄火', '转圈'],
['磕头', '回头', '跳绳', '投降', '挥手', '激动', '街舞', '左太极'], ['磕头', '回头', '跳绳', '投降', '挥手', '激动', '街舞', '左太极'],
['右太极', '嘿哈', '捂脸', '奸笑', '机智', '皱眉', '耶', '社会社会'], ['右太极', '嘿哈', '捂脸', '奸笑', '机智', '皱眉', '耶', '社会社会'],
['让我看看', '666', '红包', '蜡烛', '烟花', '福', '庆祝', '爆竹'], ['让我看看', '666', '红包', '蜡烛', '烟花', '福', '庆祝', '爆竹']
] ]
export default emoji
\ No newline at end of file \ No newline at end of file
export default emoji
//过滤器
/* eslint-disable */
const overThousandFilter = val => {
if (typeof val != 'number') {
return 0
}
if (val < 1000) return val
let a = val + ''
let b = a.split('')
b.splice(-3, 0, ',')
return b.join('')
}
export default {
overThousandFilter
}
export function isFunction (func) { export function isFunction(func) {
return (typeof func === 'function' || Object.prototype.toString.call(func) === '[object Function]') return typeof func === 'function' || Object.prototype.toString.call(func) === '[object Function]'
} }
export function snapToGrid (grid, pendingX, pendingY, scale = 1) { export function snapToGrid(grid, pendingX, pendingY, scale = 1) {
const [scaleX, scaleY] = typeof scale === 'number' ? [scale, scale] : scale const [scaleX, scaleY] = typeof scale === 'number' ? [scale, scale] : scale
const x = Math.round((pendingX / scaleX) / grid[0]) * grid[0] const x = Math.round(pendingX / scaleX / grid[0]) * grid[0]
const y = Math.round((pendingY / scaleY) / grid[1]) * grid[1] const y = Math.round(pendingY / scaleY / grid[1]) * grid[1]
return [x, y] return [x, y]
} }
export function getSize (el) { export function getSize(el) {
const rect = el.getBoundingClientRect() const rect = el.getBoundingClientRect()
return [ return [parseInt(rect.width), parseInt(rect.height)]
parseInt(rect.width),
parseInt(rect.height)
]
} }
export function computeWidth (parentWidth, left, right) { export function computeWidth(parentWidth, left, right) {
return parentWidth - left - right return parentWidth - left - right
} }
export function computeHeight (parentHeight, top, bottom) { export function computeHeight(parentHeight, top, bottom) {
return parentHeight - top - bottom return parentHeight - top - bottom
} }
export function restrictToBounds (value, min, max) { export function restrictToBounds(value, min, max) {
if (min !== null && value < min) { if (min !== null && value < min) {
return min return min
} }
......
/*
* JavaScript MD5
* https://github.com/blueimp/JavaScript-MD5
*
* Copyright 2011, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* https://opensource.org/licenses/MIT
*
* Based on
* A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
* Digest Algorithm, as defined in RFC 1321.
* Version 2.2 Copyright (C) Paul Johnston 1999 - 2009
* Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
* Distributed under the BSD License
* See http://pajhome.org.uk/crypt/md5 for more info.
*/
/* global define */
;(function ($) {
'use strict'
/*
* Add integers, wrapping at 2^32. This uses 16-bit operations internally
* to work around bugs in some JS interpreters.
*/
function safeAdd (x, y) {
var lsw = (x & 0xffff) + (y & 0xffff)
var msw = (x >> 16) + (y >> 16) + (lsw >> 16)
return (msw << 16) | (lsw & 0xffff)
}
/*
* Bitwise rotate a 32-bit number to the left.
*/
function bitRotateLeft (num, cnt) {
return (num << cnt) | (num >>> (32 - cnt))
}
/*
* These functions implement the four basic operations the algorithm uses.
*/
function md5cmn (q, a, b, x, s, t) {
return safeAdd(bitRotateLeft(safeAdd(safeAdd(a, q), safeAdd(x, t)), s), b)
}
function md5ff (a, b, c, d, x, s, t) {
return md5cmn((b & c) | (~b & d), a, b, x, s, t)
}
function md5gg (a, b, c, d, x, s, t) {
return md5cmn((b & d) | (c & ~d), a, b, x, s, t)
}
function md5hh (a, b, c, d, x, s, t) {
return md5cmn(b ^ c ^ d, a, b, x, s, t)
}
function md5ii (a, b, c, d, x, s, t) {
return md5cmn(c ^ (b | ~d), a, b, x, s, t)
}
/*
* Calculate the MD5 of an array of little-endian words, and a bit length.
*/
function binlMD5 (x, len) {
/* append padding */
x[len >> 5] |= 0x80 << (len % 32)
x[((len + 64) >>> 9 << 4) + 14] = len
var i
var olda
var oldb
var oldc
var oldd
var a = 1732584193
var b = -271733879
var c = -1732584194
var d = 271733878
for (i = 0; i < x.length; i += 16) {
olda = a
oldb = b
oldc = c
oldd = d
a = md5ff(a, b, c, d, x[i], 7, -680876936)
d = md5ff(d, a, b, c, x[i + 1], 12, -389564586)
c = md5ff(c, d, a, b, x[i + 2], 17, 606105819)
b = md5ff(b, c, d, a, x[i + 3], 22, -1044525330)
a = md5ff(a, b, c, d, x[i + 4], 7, -176418897)
d = md5ff(d, a, b, c, x[i + 5], 12, 1200080426)
c = md5ff(c, d, a, b, x[i + 6], 17, -1473231341)
b = md5ff(b, c, d, a, x[i + 7], 22, -45705983)
a = md5ff(a, b, c, d, x[i + 8], 7, 1770035416)
d = md5ff(d, a, b, c, x[i + 9], 12, -1958414417)
c = md5ff(c, d, a, b, x[i + 10], 17, -42063)
b = md5ff(b, c, d, a, x[i + 11], 22, -1990404162)
a = md5ff(a, b, c, d, x[i + 12], 7, 1804603682)
d = md5ff(d, a, b, c, x[i + 13], 12, -40341101)
c = md5ff(c, d, a, b, x[i + 14], 17, -1502002290)
b = md5ff(b, c, d, a, x[i + 15], 22, 1236535329)
a = md5gg(a, b, c, d, x[i + 1], 5, -165796510)
d = md5gg(d, a, b, c, x[i + 6], 9, -1069501632)
c = md5gg(c, d, a, b, x[i + 11], 14, 643717713)
b = md5gg(b, c, d, a, x[i], 20, -373897302)
a = md5gg(a, b, c, d, x[i + 5], 5, -701558691)
d = md5gg(d, a, b, c, x[i + 10], 9, 38016083)
c = md5gg(c, d, a, b, x[i + 15], 14, -660478335)
b = md5gg(b, c, d, a, x[i + 4], 20, -405537848)
a = md5gg(a, b, c, d, x[i + 9], 5, 568446438)
d = md5gg(d, a, b, c, x[i + 14], 9, -1019803690)
c = md5gg(c, d, a, b, x[i + 3], 14, -187363961)
b = md5gg(b, c, d, a, x[i + 8], 20, 1163531501)
a = md5gg(a, b, c, d, x[i + 13], 5, -1444681467)
d = md5gg(d, a, b, c, x[i + 2], 9, -51403784)
c = md5gg(c, d, a, b, x[i + 7], 14, 1735328473)
b = md5gg(b, c, d, a, x[i + 12], 20, -1926607734)
a = md5hh(a, b, c, d, x[i + 5], 4, -378558)
d = md5hh(d, a, b, c, x[i + 8], 11, -2022574463)
c = md5hh(c, d, a, b, x[i + 11], 16, 1839030562)
b = md5hh(b, c, d, a, x[i + 14], 23, -35309556)
a = md5hh(a, b, c, d, x[i + 1], 4, -1530992060)
d = md5hh(d, a, b, c, x[i + 4], 11, 1272893353)
c = md5hh(c, d, a, b, x[i + 7], 16, -155497632)
b = md5hh(b, c, d, a, x[i + 10], 23, -1094730640)
a = md5hh(a, b, c, d, x[i + 13], 4, 681279174)
d = md5hh(d, a, b, c, x[i], 11, -358537222)
c = md5hh(c, d, a, b, x[i + 3], 16, -722521979)
b = md5hh(b, c, d, a, x[i + 6], 23, 76029189)
a = md5hh(a, b, c, d, x[i + 9], 4, -640364487)
d = md5hh(d, a, b, c, x[i + 12], 11, -421815835)
c = md5hh(c, d, a, b, x[i + 15], 16, 530742520)
b = md5hh(b, c, d, a, x[i + 2], 23, -995338651)
a = md5ii(a, b, c, d, x[i], 6, -198630844)
d = md5ii(d, a, b, c, x[i + 7], 10, 1126891415)
c = md5ii(c, d, a, b, x[i + 14], 15, -1416354905)
b = md5ii(b, c, d, a, x[i + 5], 21, -57434055)
a = md5ii(a, b, c, d, x[i + 12], 6, 1700485571)
d = md5ii(d, a, b, c, x[i + 3], 10, -1894986606)
c = md5ii(c, d, a, b, x[i + 10], 15, -1051523)
b = md5ii(b, c, d, a, x[i + 1], 21, -2054922799)
a = md5ii(a, b, c, d, x[i + 8], 6, 1873313359)
d = md5ii(d, a, b, c, x[i + 15], 10, -30611744)
c = md5ii(c, d, a, b, x[i + 6], 15, -1560198380)
b = md5ii(b, c, d, a, x[i + 13], 21, 1309151649)
a = md5ii(a, b, c, d, x[i + 4], 6, -145523070)
d = md5ii(d, a, b, c, x[i + 11], 10, -1120210379)
c = md5ii(c, d, a, b, x[i + 2], 15, 718787259)
b = md5ii(b, c, d, a, x[i + 9], 21, -343485551)
a = safeAdd(a, olda)
b = safeAdd(b, oldb)
c = safeAdd(c, oldc)
d = safeAdd(d, oldd)
}
return [a, b, c, d]
}
/*
* Convert an array of little-endian words to a string
*/
function binl2rstr (input) {
var i
var output = ''
var length32 = input.length * 32
for (i = 0; i < length32; i += 8) {
output += String.fromCharCode((input[i >> 5] >>> (i % 32)) & 0xff)
}
return output
}
/*
* Convert a raw string to an array of little-endian words
* Characters >255 have their high-byte silently ignored.
*/
function rstr2binl (input) {
var i
var output = []
output[(input.length >> 2) - 1] = undefined
for (i = 0; i < output.length; i += 1) {
output[i] = 0
}
var length8 = input.length * 8
for (i = 0; i < length8; i += 8) {
output[i >> 5] |= (input.charCodeAt(i / 8) & 0xff) << (i % 32)
}
return output
}
/*
* Calculate the MD5 of a raw string
*/
function rstrMD5 (s) {
return binl2rstr(binlMD5(rstr2binl(s), s.length * 8))
}
/*
* Calculate the HMAC-MD5, of a key and some data (raw strings)
*/
function rstrHMACMD5 (key, data) {
var i
var bkey = rstr2binl(key)
var ipad = []
var opad = []
var hash
ipad[15] = opad[15] = undefined
if (bkey.length > 16) {
bkey = binlMD5(bkey, key.length * 8)
}
for (i = 0; i < 16; i += 1) {
ipad[i] = bkey[i] ^ 0x36363636
opad[i] = bkey[i] ^ 0x5c5c5c5c
}
hash = binlMD5(ipad.concat(rstr2binl(data)), 512 + data.length * 8)
return binl2rstr(binlMD5(opad.concat(hash), 512 + 128))
}
/*
* Convert a raw string to a hex string
*/
function rstr2hex (input) {
var hexTab = '0123456789abcdef'
var output = ''
var x
var i
for (i = 0; i < input.length; i += 1) {
x = input.charCodeAt(i)
output += hexTab.charAt((x >>> 4) & 0x0f) + hexTab.charAt(x & 0x0f)
}
return output
}
/*
* Encode a string as utf-8
*/
function str2rstrUTF8 (input) {
return unescape(encodeURIComponent(input))
}
/*
* Take string arguments and return either raw or hex encoded strings
*/
function rawMD5 (s) {
return rstrMD5(str2rstrUTF8(s))
}
function hexMD5 (s) {
return rstr2hex(rawMD5(s))
}
function rawHMACMD5 (k, d) {
return rstrHMACMD5(str2rstrUTF8(k), str2rstrUTF8(d))
}
function hexHMACMD5 (k, d) {
return rstr2hex(rawHMACMD5(k, d))
}
function md5 (string, key, raw) {
if (!key) {
if (!raw) {
return hexMD5(string)
}
return rawMD5(string)
}
if (!raw) {
return hexHMACMD5(key, string)
}
return rawHMACMD5(key, string)
}
if (typeof define === 'function' && define.amd) {
define(function () {
return md5
})
} else if (typeof module === 'object' && module.exports) {
module.exports = md5
} else {
$.md5 = md5
}
})(this)
import MD5 from 'js-md5'
const sign = (params, noSignAttr = []) => {
delete params.sign
const secret = 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b'
const keys = Object.keys(params).sort()
var str = []
// for (const key in params) {
// if (typeof params[key] === 'object') params[key] = JSON.stringify(params[key])
// }
var obj = null
for (const key in params) {
obj = params[key]
if (obj === null || obj === undefined) {
obj = ''
} else if (typeof obj === 'object') {
obj = JSON.stringify(obj)
}
params[key] = obj
}
keys.forEach(e => {
!noSignAttr.includes(e) && str.push(e + params[e])
})
params.sign = MD5(secret + str.join('') + secret)
return params
}
export default sign
(function(factory){if(typeof exports==="object"){module.exports=factory()}else if(typeof define==="function"&&define.amd){define(factory)}else{var glob;try{glob=window}catch(e){glob=self}glob.SparkMD5=factory()}})(function(undefined){"use strict";var add32=function(a,b){return a+b&4294967295},hex_chr=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function cmn(q,a,b,x,s,t){a=add32(add32(a,q),add32(x,t));return add32(a<<s|a>>>32-s,b)}function md5cycle(x,k){var a=x[0],b=x[1],c=x[2],d=x[3];a+=(b&c|~b&d)+k[0]-680876936|0;a=(a<<7|a>>>25)+b|0;d+=(a&b|~a&c)+k[1]-389564586|0;d=(d<<12|d>>>20)+a|0;c+=(d&a|~d&b)+k[2]+606105819|0;c=(c<<17|c>>>15)+d|0;b+=(c&d|~c&a)+k[3]-1044525330|0;b=(b<<22|b>>>10)+c|0;a+=(b&c|~b&d)+k[4]-176418897|0;a=(a<<7|a>>>25)+b|0;d+=(a&b|~a&c)+k[5]+1200080426|0;d=(d<<12|d>>>20)+a|0;c+=(d&a|~d&b)+k[6]-1473231341|0;c=(c<<17|c>>>15)+d|0;b+=(c&d|~c&a)+k[7]-45705983|0;b=(b<<22|b>>>10)+c|0;a+=(b&c|~b&d)+k[8]+1770035416|0;a=(a<<7|a>>>25)+b|0;d+=(a&b|~a&c)+k[9]-1958414417|0;d=(d<<12|d>>>20)+a|0;c+=(d&a|~d&b)+k[10]-42063|0;c=(c<<17|c>>>15)+d|0;b+=(c&d|~c&a)+k[11]-1990404162|0;b=(b<<22|b>>>10)+c|0;a+=(b&c|~b&d)+k[12]+1804603682|0;a=(a<<7|a>>>25)+b|0;d+=(a&b|~a&c)+k[13]-40341101|0;d=(d<<12|d>>>20)+a|0;c+=(d&a|~d&b)+k[14]-1502002290|0;c=(c<<17|c>>>15)+d|0;b+=(c&d|~c&a)+k[15]+1236535329|0;b=(b<<22|b>>>10)+c|0;a+=(b&d|c&~d)+k[1]-165796510|0;a=(a<<5|a>>>27)+b|0;d+=(a&c|b&~c)+k[6]-1069501632|0;d=(d<<9|d>>>23)+a|0;c+=(d&b|a&~b)+k[11]+643717713|0;c=(c<<14|c>>>18)+d|0;b+=(c&a|d&~a)+k[0]-373897302|0;b=(b<<20|b>>>12)+c|0;a+=(b&d|c&~d)+k[5]-701558691|0;a=(a<<5|a>>>27)+b|0;d+=(a&c|b&~c)+k[10]+38016083|0;d=(d<<9|d>>>23)+a|0;c+=(d&b|a&~b)+k[15]-660478335|0;c=(c<<14|c>>>18)+d|0;b+=(c&a|d&~a)+k[4]-405537848|0;b=(b<<20|b>>>12)+c|0;a+=(b&d|c&~d)+k[9]+568446438|0;a=(a<<5|a>>>27)+b|0;d+=(a&c|b&~c)+k[14]-1019803690|0;d=(d<<9|d>>>23)+a|0;c+=(d&b|a&~b)+k[3]-187363961|0;c=(c<<14|c>>>18)+d|0;b+=(c&a|d&~a)+k[8]+1163531501|0;b=(b<<20|b>>>12)+c|0;a+=(b&d|c&~d)+k[13]-1444681467|0;a=(a<<5|a>>>27)+b|0;d+=(a&c|b&~c)+k[2]-51403784|0;d=(d<<9|d>>>23)+a|0;c+=(d&b|a&~b)+k[7]+1735328473|0;c=(c<<14|c>>>18)+d|0;b+=(c&a|d&~a)+k[12]-1926607734|0;b=(b<<20|b>>>12)+c|0;a+=(b^c^d)+k[5]-378558|0;a=(a<<4|a>>>28)+b|0;d+=(a^b^c)+k[8]-2022574463|0;d=(d<<11|d>>>21)+a|0;c+=(d^a^b)+k[11]+1839030562|0;c=(c<<16|c>>>16)+d|0;b+=(c^d^a)+k[14]-35309556|0;b=(b<<23|b>>>9)+c|0;a+=(b^c^d)+k[1]-1530992060|0;a=(a<<4|a>>>28)+b|0;d+=(a^b^c)+k[4]+1272893353|0;d=(d<<11|d>>>21)+a|0;c+=(d^a^b)+k[7]-155497632|0;c=(c<<16|c>>>16)+d|0;b+=(c^d^a)+k[10]-1094730640|0;b=(b<<23|b>>>9)+c|0;a+=(b^c^d)+k[13]+681279174|0;a=(a<<4|a>>>28)+b|0;d+=(a^b^c)+k[0]-358537222|0;d=(d<<11|d>>>21)+a|0;c+=(d^a^b)+k[3]-722521979|0;c=(c<<16|c>>>16)+d|0;b+=(c^d^a)+k[6]+76029189|0;b=(b<<23|b>>>9)+c|0;a+=(b^c^d)+k[9]-640364487|0;a=(a<<4|a>>>28)+b|0;d+=(a^b^c)+k[12]-421815835|0;d=(d<<11|d>>>21)+a|0;c+=(d^a^b)+k[15]+530742520|0;c=(c<<16|c>>>16)+d|0;b+=(c^d^a)+k[2]-995338651|0;b=(b<<23|b>>>9)+c|0;a+=(c^(b|~d))+k[0]-198630844|0;a=(a<<6|a>>>26)+b|0;d+=(b^(a|~c))+k[7]+1126891415|0;d=(d<<10|d>>>22)+a|0;c+=(a^(d|~b))+k[14]-1416354905|0;c=(c<<15|c>>>17)+d|0;b+=(d^(c|~a))+k[5]-57434055|0;b=(b<<21|b>>>11)+c|0;a+=(c^(b|~d))+k[12]+1700485571|0;a=(a<<6|a>>>26)+b|0;d+=(b^(a|~c))+k[3]-1894986606|0;d=(d<<10|d>>>22)+a|0;c+=(a^(d|~b))+k[10]-1051523|0;c=(c<<15|c>>>17)+d|0;b+=(d^(c|~a))+k[1]-2054922799|0;b=(b<<21|b>>>11)+c|0;a+=(c^(b|~d))+k[8]+1873313359|0;a=(a<<6|a>>>26)+b|0;d+=(b^(a|~c))+k[15]-30611744|0;d=(d<<10|d>>>22)+a|0;c+=(a^(d|~b))+k[6]-1560198380|0;c=(c<<15|c>>>17)+d|0;b+=(d^(c|~a))+k[13]+1309151649|0;b=(b<<21|b>>>11)+c|0;a+=(c^(b|~d))+k[4]-145523070|0;a=(a<<6|a>>>26)+b|0;d+=(b^(a|~c))+k[11]-1120210379|0;d=(d<<10|d>>>22)+a|0;c+=(a^(d|~b))+k[2]+718787259|0;c=(c<<15|c>>>17)+d|0;b+=(d^(c|~a))+k[9]-343485551|0;b=(b<<21|b>>>11)+c|0;x[0]=a+x[0]|0;x[1]=b+x[1]|0;x[2]=c+x[2]|0;x[3]=d+x[3]|0}function md5blk(s){var md5blks=[],i;for(i=0;i<64;i+=4){md5blks[i>>2]=s.charCodeAt(i)+(s.charCodeAt(i+1)<<8)+(s.charCodeAt(i+2)<<16)+(s.charCodeAt(i+3)<<24)}return md5blks}function md5blk_array(a){var md5blks=[],i;for(i=0;i<64;i+=4){md5blks[i>>2]=a[i]+(a[i+1]<<8)+(a[i+2]<<16)+(a[i+3]<<24)}return md5blks}function md51(s){var n=s.length,state=[1732584193,-271733879,-1732584194,271733878],i,length,tail,tmp,lo,hi;for(i=64;i<=n;i+=64){md5cycle(state,md5blk(s.substring(i-64,i)))}s=s.substring(i-64);length=s.length;tail=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(i=0;i<length;i+=1){tail[i>>2]|=s.charCodeAt(i)<<(i%4<<3)}tail[i>>2]|=128<<(i%4<<3);if(i>55){md5cycle(state,tail);for(i=0;i<16;i+=1){tail[i]=0}}tmp=n*8;tmp=tmp.toString(16).match(/(.*?)(.{0,8})$/);lo=parseInt(tmp[2],16);hi=parseInt(tmp[1],16)||0;tail[14]=lo;tail[15]=hi;md5cycle(state,tail);return state}function md51_array(a){var n=a.length,state=[1732584193,-271733879,-1732584194,271733878],i,length,tail,tmp,lo,hi;for(i=64;i<=n;i+=64){md5cycle(state,md5blk_array(a.subarray(i-64,i)))}a=i-64<n?a.subarray(i-64):new Uint8Array(0);length=a.length;tail=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(i=0;i<length;i+=1){tail[i>>2]|=a[i]<<(i%4<<3)}tail[i>>2]|=128<<(i%4<<3);if(i>55){md5cycle(state,tail);for(i=0;i<16;i+=1){tail[i]=0}}tmp=n*8;tmp=tmp.toString(16).match(/(.*?)(.{0,8})$/);lo=parseInt(tmp[2],16);hi=parseInt(tmp[1],16)||0;tail[14]=lo;tail[15]=hi;md5cycle(state,tail);return state}function rhex(n){var s="",j;for(j=0;j<4;j+=1){s+=hex_chr[n>>j*8+4&15]+hex_chr[n>>j*8&15]}return s}function hex(x){var i;for(i=0;i<x.length;i+=1){x[i]=rhex(x[i])}return x.join("")}if(hex(md51("hello"))!=="5d41402abc4b2a76b9719d911017c592"){add32=function(x,y){var lsw=(x&65535)+(y&65535),msw=(x>>16)+(y>>16)+(lsw>>16);return msw<<16|lsw&65535}}if(typeof ArrayBuffer!=="undefined"&&!ArrayBuffer.prototype.slice){(function(){function clamp(val,length){val=val|0||0;if(val<0){return Math.max(val+length,0)}return Math.min(val,length)}ArrayBuffer.prototype.slice=function(from,to){var length=this.byteLength,begin=clamp(from,length),end=length,num,target,targetArray,sourceArray;if(to!==undefined){end=clamp(to,length)}if(begin>end){return new ArrayBuffer(0)}num=end-begin;target=new ArrayBuffer(num);targetArray=new Uint8Array(target);sourceArray=new Uint8Array(this,begin,num);targetArray.set(sourceArray);return target}})()}function toUtf8(str){if(/[\u0080-\uFFFF]/.test(str)){str=unescape(encodeURIComponent(str))}return str}function utf8Str2ArrayBuffer(str,returnUInt8Array){var length=str.length,buff=new ArrayBuffer(length),arr=new Uint8Array(buff),i;for(i=0;i<length;i+=1){arr[i]=str.charCodeAt(i)}return returnUInt8Array?arr:buff}function arrayBuffer2Utf8Str(buff){return String.fromCharCode.apply(null,new Uint8Array(buff))}function concatenateArrayBuffers(first,second,returnUInt8Array){var result=new Uint8Array(first.byteLength+second.byteLength);result.set(new Uint8Array(first));result.set(new Uint8Array(second),first.byteLength);return returnUInt8Array?result:result.buffer}function hexToBinaryString(hex){var bytes=[],length=hex.length,x;for(x=0;x<length-1;x+=2){bytes.push(parseInt(hex.substr(x,2),16))}return String.fromCharCode.apply(String,bytes)}function SparkMD5(){this.reset()}SparkMD5.prototype.append=function(str){this.appendBinary(toUtf8(str));return this};SparkMD5.prototype.appendBinary=function(contents){this._buff+=contents;this._length+=contents.length;var length=this._buff.length,i;for(i=64;i<=length;i+=64){md5cycle(this._hash,md5blk(this._buff.substring(i-64,i)))}this._buff=this._buff.substring(i-64);return this};SparkMD5.prototype.end=function(raw){var buff=this._buff,length=buff.length,i,tail=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],ret;for(i=0;i<length;i+=1){tail[i>>2]|=buff.charCodeAt(i)<<(i%4<<3)}this._finish(tail,length);ret=hex(this._hash);if(raw){ret=hexToBinaryString(ret)}this.reset();return ret};SparkMD5.prototype.reset=function(){this._buff="";this._length=0;this._hash=[1732584193,-271733879,-1732584194,271733878];return this};SparkMD5.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash}};SparkMD5.prototype.setState=function(state){this._buff=state.buff;this._length=state.length;this._hash=state.hash;return this};SparkMD5.prototype.destroy=function(){delete this._hash;delete this._buff;delete this._length};SparkMD5.prototype._finish=function(tail,length){var i=length,tmp,lo,hi;tail[i>>2]|=128<<(i%4<<3);if(i>55){md5cycle(this._hash,tail);for(i=0;i<16;i+=1){tail[i]=0}}tmp=this._length*8;tmp=tmp.toString(16).match(/(.*?)(.{0,8})$/);lo=parseInt(tmp[2],16);hi=parseInt(tmp[1],16)||0;tail[14]=lo;tail[15]=hi;md5cycle(this._hash,tail)};SparkMD5.hash=function(str,raw){return SparkMD5.hashBinary(toUtf8(str),raw)};SparkMD5.hashBinary=function(content,raw){var hash=md51(content),ret=hex(hash);return raw?hexToBinaryString(ret):ret};SparkMD5.ArrayBuffer=function(){this.reset()};SparkMD5.ArrayBuffer.prototype.append=function(arr){var buff=concatenateArrayBuffers(this._buff.buffer,arr,true),length=buff.length,i;this._length+=arr.byteLength;for(i=64;i<=length;i+=64){md5cycle(this._hash,md5blk_array(buff.subarray(i-64,i)))}this._buff=i-64<length?new Uint8Array(buff.buffer.slice(i-64)):new Uint8Array(0);return this};SparkMD5.ArrayBuffer.prototype.end=function(raw){var buff=this._buff,length=buff.length,tail=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],i,ret;for(i=0;i<length;i+=1){tail[i>>2]|=buff[i]<<(i%4<<3)}this._finish(tail,length);ret=hex(this._hash);if(raw){ret=hexToBinaryString(ret)}this.reset();return ret};SparkMD5.ArrayBuffer.prototype.reset=function(){this._buff=new Uint8Array(0);this._length=0;this._hash=[1732584193,-271733879,-1732584194,271733878];return this};SparkMD5.ArrayBuffer.prototype.getState=function(){var state=SparkMD5.prototype.getState.call(this);state.buff=arrayBuffer2Utf8Str(state.buff);return state};SparkMD5.ArrayBuffer.prototype.setState=function(state){state.buff=utf8Str2ArrayBuffer(state.buff,true);return SparkMD5.prototype.setState.call(this,state)};SparkMD5.ArrayBuffer.prototype.destroy=SparkMD5.prototype.destroy;SparkMD5.ArrayBuffer.prototype._finish=SparkMD5.prototype._finish;SparkMD5.ArrayBuffer.hash=function(arr,raw){var hash=md51_array(new Uint8Array(arr)),ret=hex(hash);return raw?hexToBinaryString(ret):ret};return SparkMD5});
import MD5 from 'md5'
var w = {}
let uploadInfo = {}
let that = {}
const options = {
showprocess: true,
action: '',
tips: '',
size: 2,
url: '',
success: ''
}
that.config = {
id: '',
token: '',
app_key: '48e5e13229b82c1b4e6e8c96151f0637',
v: '1.0.0',
format: 'json',
url: 'http://qcdidicb.glsx.com.cn:7060/router',
secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b'
}
/**
* 参数序列化
*/
uploadInfo.formRequestData = function(data) {
var _sendstr = null
if (data) {
_sendstr = ''
for (var i in data) {
_sendstr += (_sendstr ? '&' : '') + i + '=' + encodeURIComponent(data[i])
}
}
return _sendstr
}
/**
* 检查文件是否上传
*/
/**
* 文件切片
*/
uploadInfo.fileSlice = function(oParams) {
if (!oParams) {
return false
}
var o = options
var file = oParams.file
var cellBlod = []
var cell = Number(o.size) * 1024 * 1024 //单个分片的大小
var size = oParams.size //文件大小
var num = Math.ceil(size / cell) //计算分片的个数
if (num == 1) {
cellBlod.push(file)
} else {
for (var i = 0; i < num; i++) {
var s = i * cell
var e = (i + 1) * cell
var m = ''
if (file.slice) {
m = file.slice(s, e)
}
//兼容firefox
if (file.mozSlice) {
m = file.mozSlice(s, e)
}
// 兼容webkit
if (file.webkitSlice) {
m = file.webkitSlice(s, e)
}
cellBlod.push(m)
}
}
return cellBlod
}
/**
* 获取文件类型
*/
uploadInfo.getFileType = function(file) {
if (!file) {
return false
}
var arr = file.split('.')
return arr[arr.length - 1]
}
/**
* arrbuffer转换成base64
*/
uploadInfo.transformArrayBufferToBase64 = function(buffer) {
var binary = ''
var bytes = new Uint8Array(buffer)
for (var len = bytes.byteLength, i = 0; i < len; i++) {
binary += String.fromCharCode(bytes[i])
}
return window.btoa(binary)
}
/**
* 生成签名
*/
uploadInfo.createSign = function(params) {
var secret = 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b'
var noSignAttr = []
delete params.sign
noSignAttr.push('refreshTable')
var keys = Object.keys(params).sort()
var str = []
var obj = null
for (const key in params) {
obj = params[key]
if (obj === null || obj === undefined) {
obj = ''
} else if (typeof obj === 'object') {
obj = JSON.stringify(obj)
}
params[key] = obj
}
keys.forEach(e => {
!noSignAttr.includes(e) && str.push(e + params[e])
})
params.sign = MD5(secret + str.join('') + secret)
return params
}
/**
* 获取参数
*/
uploadInfo.getParams = function(index, oInfo) {
var o = that.options
var k = that.config
var oParams = {}
var len = w.list.length
var size = Number(o.size * 1024 * 1024)
// console.log(o.size)
// console.log(w);
// console.log('个数:' + w.list.length);
// console.log('当前个数' + index)
if (len > 1 && index == len - 1) {
size = w.fileSize - o.size * 1024 * 1024 * (w.list.length - 2)
}
//只有一个分片
if (w.list.length == 1) {
size = w.fileSize
}
var spark = new MD5()
spark.append(oInfo)
oParams.app_key = k.app_key
oParams.v = k.v
oParams.timestamp = new Date().getTime()
oParams.format = k.format
oParams.source = '2323242323'
oParams.method = 'glsx.accounts.biz.common.uploadFileWithFileInfo'
oParams.token = w.token
oParams.number = index + 1
oParams.fileType = w.fileType
oParams.fileName = w.fileName
oParams.fileSize = w.fileSize
oParams.fileFragmentSize = size
oParams.fileUpSum = w.list.length
oParams.fileMD5 = w.fileMD5
oParams.fragmentMD5 = spark.end()
// for (let k in m) {
// oParams.append(k, m[k]);
// }
return uploadInfo.createSign(oParams)
}
export default uploadInfo
import { Message } from 'element-ui' import { Message } from 'element-ui'
let util = {} let util = {}
util.cloneText = function (message) { util.cloneText = function(message) {
let input = document.createElement('input') let input = document.createElement('input')
input.value = message input.value = message
document.body.appendChild(input) document.body.appendChild(input)
input.select() input.select()
input.setSelectionRange(0, input.value.length), document.execCommand('Copy') input.setSelectionRange(0, input.value.length), document.execCommand('Copy')
document.body.removeChild(input) document.body.removeChild(input)
Message.success('复制成功') Message.success('复制成功')
} }
util.getBeforeDate = function (sign = '-') { util.getBeforeDate = function(sign = '-') {
let day = new Date(); let day = new Date()
let month = day.getMonth() + 1; let month = day.getMonth() + 1
let date = day.getDate(); let date = day.getDate()
if (month < 10) month = '0' + month; if (month < 10) month = '0' + month
if (date < 10) date = '0' + date; if (date < 10) date = '0' + date
var s = day.getFullYear() + sign + month + sign + date; var s = day.getFullYear() + sign + month + sign + date
return s; return s
} }
util.getBeforeMonth = function (days) { util.getBeforeMonth = function(days) {
let month = new Date().getMonth() + 1; let month = new Date().getMonth() + 1
let year = new Date().getFullYear(); let year = new Date().getFullYear()
let arr = new Array(); let arr = new Array()
for (let i = 0; i < days; i++) { for (let i = 0; i < days; i++) {
if (month <= 0) { if (month <= 0) {
year = year - 1; year = year - 1
month = month + 12; month = month + 12
}
if (month < 10) month = '0' + month;
arr[i] = year + '年' + month + '月'
month--
} }
return arr; if (month < 10) month = '0' + month
arr[i] = year + '年' + month + '月'
month--
}
return arr
} }
/** /**
* 格式化时间 * 格式化时间
* @param {Array} time * @param {Array} time
*/ */
util.formatTime = function (time) { util.formatTime = function(time) {
return { return {
startTime: time ? time[0] + ' ' + '00:00:00' : '', startTime: time ? time[0] + ' ' + '00:00:00' : '',
endTime: time ? time[1] + ' ' + '23:59:59' : '' endTime: time ? time[1] + ' ' + '23:59:59' : ''
} }
} }
util.tringToDate = function (dateStr, separator) { util.tringToDate = function(dateStr, separator) {
if (!separator) { if (!separator) {
separator = "-"; separator = '-'
} }
var dateArr = dateStr.split(separator); var dateArr = dateStr.split(separator)
var year = parseInt(dateArr[0]); var year = parseInt(dateArr[0])
var month; var month
//处理月份为04这样的情况 //处理月份为04这样的情况
if (dateArr[1].indexOf("0") == 0) { if (dateArr[1].indexOf('0') == 0) {
month = parseInt(dateArr[1].substring(1)); month = parseInt(dateArr[1].substring(1))
} else { } else {
month = parseInt(dateArr[1]); month = parseInt(dateArr[1])
} }
var day = parseInt(dateArr[2]); var day = parseInt(dateArr[2])
var date = new Date(year, month - 1, day); var date = new Date(year, month - 1, day)
return date; return date
}
util.getDay = function(num, str = '-') {
var today = new Date()
var nowTime = today.getTime()
var ms = 24 * 3600 * 1000 * num
today.setTime(parseInt(nowTime + ms))
var oYear = today.getFullYear()
var oMoth = (today.getMonth() + 1).toString()
if (oMoth.length <= 1) oMoth = '0' + oMoth
var oDay = today.getDate().toString()
if (oDay.length <= 1) oDay = '0' + oDay
return oYear + str + oMoth + str + oDay
}
util.openUrl = function(url) {
const link = document.createElement('a')
link.href = url
link.target = '_blank'
link.rel = 'opener'
link.click()
} }
util.getDay = function (num, str = '-') { util.downloadUrl = function(url) {
var today = new Date(); const link = document.createElement('a')
var nowTime = today.getTime(); link.href = url
var ms = 24 * 3600 * 1000 * num; document.body.appendChild(link)
today.setTime(parseInt(nowTime + ms)); link.click()
var oYear = today.getFullYear(); document.body.removeChild(link)
var oMoth = (today.getMonth() + 1).toString();
if (oMoth.length <= 1) oMoth = '0' + oMoth;
var oDay = today.getDate().toString();
if (oDay.length <= 1) oDay = '0' + oDay;
return oYear + str + oMoth + str + oDay;
} }
util.openUrl = function (url) { util.getArrayIsSubset = (arr2, arr1) => {
const link = document.createElement('a') return arr1.every(item => {
link.href = url return arr2.includes(item)
link.target = '_blank' })
link.rel = 'opener'
link.click()
} }
util.downloadIamge = function (imgsrc, name = new Date().getTime()) { util.downloadIamge = function(imgsrc, name = new Date().getTime()) {
//下载图片地址和图片名 //下载图片地址和图片名
var image = new Image(); var image = new Image()
// 解决跨域 Canvas 污染问题 // 解决跨域 Canvas 污染问题
image.setAttribute("crossOrigin", "anonymous"); image.setAttribute('crossOrigin', 'anonymous')
image.onload = function () { image.onload = function() {
var canvas = document.createElement("canvas"); var canvas = document.createElement('canvas')
canvas.width = image.width; canvas.width = image.width
canvas.height = image.height; canvas.height = image.height
var context = canvas.getContext("2d"); var context = canvas.getContext('2d')
context.drawImage(image, 0, 0, image.width, image.height); context.drawImage(image, 0, 0, image.width, image.height)
var url = canvas.toDataURL("image/png"); //得到图片的base64编码数据 var url = canvas.toDataURL('image/png') //得到图片的base64编码数据
var a = document.createElement("a"); // 生成一个a元素 var a = document.createElement('a') // 生成一个a元素
var event = new MouseEvent("click"); // 创建一个单击事件 var event = new MouseEvent('click') // 创建一个单击事件
a.download = name || "photo"; // 设置图片名称 a.download = name || 'photo' // 设置图片名称
a.href = url; // 将生成的URL设置为a.href属性 a.href = url // 将生成的URL设置为a.href属性
a.dispatchEvent(event); // 触发a的单击事件 a.dispatchEvent(event) // 触发a的单击事件
}; }
image.src = imgsrc; image.src = imgsrc
} }
export default util
\ No newline at end of file \ No newline at end of file
export default util
...@@ -79,15 +79,16 @@ ...@@ -79,15 +79,16 @@
<el-switch v-model="autoWelcome" active-color="#5850FF" inactive-color="#999999"></el-switch> <el-switch v-model="autoWelcome" active-color="#5850FF" inactive-color="#999999"></el-switch>
</div> </div>
<div class="welcome-box" v-show="autoWelcome"> <div class="welcome-box" v-show="autoWelcome">
<welcome-words :eventBus="eventBus" ref="welcome"></welcome-words> <!-- <welcome-words :eventBus="eventBus" ref="welcome"></welcome-words> -->
<GLEditor ref="welcome" :form="'customer'" :btnList="btnList" @previewWord="previewForm"></GLEditor>
</div> </div>
</div> </div>
</div> </div>
<GLFooter <GLFooter>
>
<el-button type="primary" @click="handleSave">提交</el-button> <el-button type="primary" @click="handleSave">提交</el-button>
<el-button @click="goback">取消</el-button> <el-button @click="goback">取消</el-button>
</GLFooter> </GLFooter>
<GLDialog title="提示" @onOk="handleSure" @onCancel="dialogVisible = false" type="warning" content="当前有内容信息未保存,是否继续返回?" :visible.sync="dialogVisible" mode="small"></GLDialog>
<select-emp @selectTable="selectTable" ref="selectEmpForm"></select-emp> <select-emp @selectTable="selectTable" ref="selectEmpForm"></select-emp>
<select-tag ref="selectTagForm" @tagSelected="tagSelected"></select-tag> <select-tag ref="selectTagForm" @tagSelected="tagSelected"></select-tag>
</div> </div>
...@@ -95,16 +96,16 @@ ...@@ -95,16 +96,16 @@
<script> <script>
import { utils } from 'glsx-common' import { utils } from 'glsx-common'
import Vue from 'vue'
import selectEmp from '@/components/selectEmp' import selectEmp from '@/components/selectEmp'
import selectTag from '@/components/selectTag' import selectTag from '@/components/selectTag'
import welcomeWords from '@/components/welcome/welcomeWords.vue' import word from '@/mixins/word'
export default { export default {
mixins: [word],
name: 'addCode', name: 'addCode',
components: { welcomeWords, selectEmp, selectTag }, components: { selectEmp, selectTag },
data() { data() {
return { return {
eventBus: new Vue(), dialogVisible: false,
addCodeForm: { addCodeForm: {
codeName: '', codeName: '',
codeRemark: '', codeRemark: '',
...@@ -164,17 +165,14 @@ export default { ...@@ -164,17 +165,14 @@ export default {
}) })
}) })
if (this.editStatus || (this.$refs.welcome.previewList.length > 0 && !this.codeId)) { if (this.editStatus || (this.$refs.welcome.previewList.length > 0 && !this.codeId)) {
this.$confirm('当前有内容信息未保存,是否继续返回?', '提示', { this.dialogVisible = true
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$router.push('/channel/index')
})
} else { } else {
this.$router.push('/channel/index') this.$router.push('/channel/index')
} }
}, },
handleSure() {
this.$router.push('/channel/index')
},
removeTag(item, idx, index) { removeTag(item, idx, index) {
item.labelList.splice(idx, 1) item.labelList.splice(idx, 1)
if (item.labelList.length == 0) { if (item.labelList.length == 0) {
...@@ -202,7 +200,7 @@ export default { ...@@ -202,7 +200,7 @@ export default {
tagSelected(item) { tagSelected(item) {
this.tagging = item this.tagging = item
}, },
handleSave: utils.debounce(function () { handleSave: utils.debounce(function() {
if (this.staffInfo.length == 0) { if (this.staffInfo.length == 0) {
this.staffStatus = true this.staffStatus = true
return return
...@@ -245,7 +243,9 @@ export default { ...@@ -245,7 +243,9 @@ export default {
if (item.attType == 1) { if (item.attType == 1) {
item.attContent = item.attContent.replaceAll('[@昵称]', '@昵称') item.attContent = item.attContent.replaceAll('[@昵称]', '@昵称')
item.attContent = item.attContent.replaceAll('@昵称', '[@昵称]') item.attContent = item.attContent.replaceAll('@昵称', '[@昵称]')
} } else if (item.attType == 7) {
item.attContent = JSON.stringify(item.attContent)
}
return item return item
}) })
param.welcomeInfo = attachmentList param.welcomeInfo = attachmentList
...@@ -294,7 +294,7 @@ export default { ...@@ -294,7 +294,7 @@ export default {
this.previewListStart = this.$common.utils.deepClone(this.$refs.welcome.previewList) this.previewListStart = this.$common.utils.deepClone(this.$refs.welcome.previewList)
}) })
}) })
}, }
// resize() { // resize() {
// this.footerLeft = document.querySelector('.base-container-right').offsetLeft // this.footerLeft = document.querySelector('.base-container-right').offsetLeft
// this.footerWidth = document.documentElement.clientWidth - this.footerLeft // this.footerWidth = document.documentElement.clientWidth - this.footerLeft
...@@ -311,11 +311,11 @@ export default { ...@@ -311,11 +311,11 @@ export default {
} }
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.channel-main-welcome { .channel-main-welcome {
margin: 20px 0px 60px; margin: 20px 0px 16px;
.welcome-panel { .welcome-panel {
margin: 10px; margin: 10px;
padding: 0px 20px 20px; padding: 0px 20px 20px;
...@@ -404,4 +404,4 @@ export default { ...@@ -404,4 +404,4 @@ export default {
margin-bottom: 5px; margin-bottom: 5px;
} }
} }
</style>
\ No newline at end of file \ No newline at end of file
</style>
...@@ -4,20 +4,7 @@ ...@@ -4,20 +4,7 @@
<GLButton type="primary" size="small" icon="el-icon-add" @click="handleAddCode" fn="新增活码">新建渠道活码</GLButton> <GLButton type="primary" size="small" icon="el-icon-add" @click="handleAddCode" fn="新增活码">新建渠道活码</GLButton>
</div> </div>
<div class="form-panel scrm-box-f"> <div class="form-panel scrm-box-f">
<el-form :inline="true" :model="tableSearchForm" class="follow-form-item"> <GLCombiForm :rowNumber="1" ref="formSearch" :formObj="tableSearchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<el-row>
<el-form-item size="small" label="渠道名称或备注">
<el-input size="small" v-model="tableSearchForm.codeNameAndRemark" placeholder="请输入渠道名称或备注"></el-input>
</el-form-item>
<el-form-item size="small" label="关联专员" style="margin-left: 20px">
<el-input size="small" v-model="tableSearchForm.staffName" placeholder="请输入关联专员"></el-input>
</el-form-item>
<el-form-item size="small" style="float: right">
<el-button @click="handleReset">重置</el-button>
<el-button type="primary" @click="handleSearch">查询</el-button>
</el-form-item>
</el-row>
</el-form>
<GLTable v-loading="loading" ref="table" @refreshTable="handleSearch" :searchForm="tableSearchForm" :layout="layout" :tableData="tableData" :tableTotal="tableTotal" :pageConf="pageConf" :tableParams="tableParams"> <GLTable v-loading="loading" ref="table" @refreshTable="handleSearch" :searchForm="tableSearchForm" :layout="layout" :tableData="tableData" :tableTotal="tableTotal" :pageConf="pageConf" :tableParams="tableParams">
<div class="table-btns" slot="optionBtns" slot-scope="scope"> <div class="table-btns" slot="optionBtns" slot-scope="scope">
<GLButton type="text" @click="handleDetail(scope.scope)" fn="到店咨询客户数据">数据</GLButton> <GLButton type="text" @click="handleDetail(scope.scope)" fn="到店咨询客户数据">数据</GLButton>
...@@ -34,22 +21,22 @@ ...@@ -34,22 +21,22 @@
<div v-else>0</div> <div v-else>0</div>
</div> </div>
<div slot="staffInfo" slot-scope="scope"> <div slot="staffInfo" slot-scope="scope">
<el-popover trigger="hover" placement="top" v-if="scope.scope.staffName.split(',').length > 3"> <el-popover trigger="hover" placement="top" v-if="staffNameSplit(scope.scope.staffName).length > 3">
<div class="accountType-row" v-for="(item, index) in scope.scope.staffName.split(',')" :key="index"> <div class="accountType-row" v-for="(item, index) in staffNameSplit(scope.scope.staffName)" :key="index">
<i class="el-icon-user-solid"></i> <i class="el-icon-user-solid"></i>
<GLTitle :content="item" textLength="4"></GLTitle> <GLTitle :content="item" textLength="4"></GLTitle>
</div> </div>
<div slot="reference" class="name-wrapper"> <div slot="reference" class="name-wrapper">
<div v-for="(item, index) in scope.scope.staffName.split(',')" :key="index" v-show="index < 4"> <div v-for="(item, index) in staffNameSplit(scope.scope.staffName)" :key="index" v-show="index < 4">
<div class="accountType-row"> <div class="accountType-row">
<i class="el-icon-user-solid"></i> <i class="el-icon-user-solid"></i>
<span v-if="index == 3 && scope.scope.staffName.split(',').length > 3">{{ '...(' + scope.scope.staffName.split(',').length + ')' }}</span> <span v-if="index == 3 && staffNameSplit(scope.scope.staffName).length > 3">{{ '...(' + staffNameSplit(scope.scope.staffName).length + ')' }}</span>
<GLTitle :content="item" textLength="4" v-else></GLTitle> <GLTitle :content="item" textLength="4" v-else></GLTitle>
</div> </div>
</div> </div>
</div> </div>
</el-popover> </el-popover>
<div v-for="(item, index) in scope.scope.staffName.split(',')" :key="index" v-else> <div v-for="(item, index) in staffNameSplit(scope.scope.staffName)" :key="index" v-else>
<div class="accountType-row"> <div class="accountType-row">
<i class="el-icon-user-solid"></i> <i class="el-icon-user-solid"></i>
<GLTitle :content="item" textLength="4"></GLTitle> <GLTitle :content="item" textLength="4"></GLTitle>
...@@ -90,6 +77,7 @@ ...@@ -90,6 +77,7 @@
</div> </div>
</GLTable> </GLTable>
</div> </div>
<GLDialog title="提示" @onOk="handleSure" @onCancel="dialogVisibleDel = false" type="error" content="是否删除?" :visible.sync="dialogVisibleDel" mode="small"></GLDialog>
<emp-detail ref="empDetailForm"></emp-detail> <emp-detail ref="empDetailForm"></emp-detail>
</div> </div>
</template> </template>
...@@ -102,8 +90,27 @@ export default { ...@@ -102,8 +90,27 @@ export default {
name: 'channelList', name: 'channelList',
data() { data() {
return { return {
dialogVisibleDel: false,
selectItem: '',
loading: false, loading: false,
tableSearchForm: {}, tableSearchForm: {
staffName: '',
codeNameAndRemark: ''
},
searchFormData: [
{
label: '渠道名称或备注',
name: 'codeNameAndRemark',
type: 'input',
placeholder: '请输入渠道名称或备注'
},
{
label: '关联专员',
name: 'staffName',
type: 'input',
placeholder: '请输入关联专员'
}
],
tableData: [], tableData: [],
tableParams: { tableParams: {
listName: 'data', listName: 'data',
...@@ -117,13 +124,13 @@ export default { ...@@ -117,13 +124,13 @@ export default {
{ {
label: '今日新增客户数', label: '今日新增客户数',
prop: 'yesterdayNum', prop: 'yesterdayNum',
width: '120px', width: '130px',
addHtml: 'yesterdayNum' addHtml: 'yesterdayNum'
}, },
{ {
label: '总新增客户数', label: '总新增客户数',
prop: 'totalNum', prop: 'totalNum',
width: '150px', width: '120px',
addHtml: 'totalNum' addHtml: 'totalNum'
}, },
{ {
...@@ -147,12 +154,12 @@ export default { ...@@ -147,12 +154,12 @@ export default {
{ {
label: '创建时间', label: '创建时间',
prop: 'createdTime', prop: 'createdTime',
width: '160px' width: '180px'
}, },
{ {
label: '操作', label: '操作',
prop: 'optionBtns', prop: 'optionBtns',
width: '140px', width: '220px',
addHtml: 'optionBtns', addHtml: 'optionBtns',
fixed: 'right' fixed: 'right'
} }
...@@ -164,6 +171,9 @@ export default { ...@@ -164,6 +171,9 @@ export default {
} }
}, },
methods: { methods: {
staffNameSplit(name) {
return name ? name.split(',') : ''
},
handleDetail(scope) { handleDetail(scope) {
this.$router.push('/channel/store/' + scope.id + '/' + scope.codeUuid + '/' + scope.codeState) this.$router.push('/channel/store/' + scope.id + '/' + scope.codeUuid + '/' + scope.codeState)
}, },
...@@ -208,30 +218,28 @@ export default { ...@@ -208,30 +218,28 @@ export default {
}) })
.catch(() => {}) .catch(() => {})
}, },
handleDelete(scope) { handleSure() {
this.$confirm('是否删除?', '提示', { const { id, codeUuid, configId } = this.selectItem
confirmButtonText: '确定', this.$apis.channel
cancelButtonText: '取消', .deleteChannelCode({
type: 'warning' id,
}) codeUuid,
.then(() => { configId
this.$apis.channel })
.deleteChannelCode({ .then(res => {
id: scope.id, if (res) {
codeUuid: scope.codeUuid, this.$message({
configId: scope.configId type: 'success',
}) message: '删除成功!'
.then(res => {
if (res) {
this.$message({
type: 'success',
message: '删除成功!'
})
}
this.handleSearch()
}) })
}
this.handleSearch()
}) })
.catch(() => {}) this.dialogVisibleDel = false
},
handleDelete(scope) {
this.dialogVisibleDel = true
this.selectItem = scope
}, },
listChannelCodeByPage() { listChannelCodeByPage() {
const params = { const params = {
...@@ -265,7 +273,7 @@ export default { ...@@ -265,7 +273,7 @@ export default {
this.listChannelCodeByPage() this.listChannelCodeByPage()
} }
} }
</script> </script>
<style> <style>
.el-popover { .el-popover {
max-width: 800px; max-width: 800px;
...@@ -415,4 +423,4 @@ export default { ...@@ -415,4 +423,4 @@ export default {
// top: 7px; // top: 7px;
// } // }
} }
</style>
\ No newline at end of file \ No newline at end of file
</style>
...@@ -156,7 +156,7 @@ export default { ...@@ -156,7 +156,7 @@ export default {
this.codeSearch() this.codeSearch()
}, },
handleTab() { handleTab() {
this.createTime = []; this.createTime = []
this.trendType = this.timeRadio this.trendType = this.timeRadio
this.createTime = '' this.createTime = ''
this.endTime = '' this.endTime = ''
...@@ -260,7 +260,7 @@ export default { ...@@ -260,7 +260,7 @@ export default {
this.getFollower() this.getFollower()
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.channel-main { .channel-main {
...@@ -345,4 +345,4 @@ export default { ...@@ -345,4 +345,4 @@ export default {
} }
} }
} }
</style>
\ No newline at end of file \ No newline at end of file
</style>
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
<el-button type="primary" @click="handleSearch">查询</el-button> <el-button type="primary" @click="handleSearch">查询</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<!-- <GLCombiForm ref="formSearch" :formObj="tableSearchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm> -->
<GLTable v-loading="loading" ref="table" :layout="layout" :tableData="tableData" :tableTotal="tableTotal" :pageConf="pageConf" :tableParams="tableParams" @refreshTable="handleSearch" @selectionTable="selectionTable"> <GLTable v-loading="loading" ref="table" :layout="layout" :tableData="tableData" :tableTotal="tableTotal" :pageConf="pageConf" :tableParams="tableParams" @refreshTable="handleSearch" @selectionTable="selectionTable">
<div class="table-btns" slot="optionBtns" slot-scope="scope"> <div class="table-btns" slot="optionBtns" slot-scope="scope">
<el-button type="text" @click="handleDetail(scope.scope)">详情</el-button> <el-button type="text" @click="handleDetail(scope.scope)">详情</el-button>
...@@ -32,9 +33,9 @@ ...@@ -32,9 +33,9 @@
</template> </template>
<template slot="customerName" slot-scope="scope"> <template slot="customerName" slot-scope="scope">
<div class="form-row"> <div class="form-row">
<img :src="scope.scope.avatar" v-if="scope.scope.avatar"> <img :src="scope.scope.avatar" v-if="scope.scope.avatar" />
{{ scope.scope.customerName }} {{ scope.scope.customerName }}
<span style="color: #5850ff">{{ scope.scope.type == 1 ? '@微信' : scope.scope.type == 2 ? '@企微' : '' }}</span> <span style="color: #5850ff">{{ scope.scope.type == 1 ? '@微信' : '@企微' }}</span>
</div> </div>
</template> </template>
</GLTable> </GLTable>
...@@ -71,6 +72,70 @@ export default { ...@@ -71,6 +72,70 @@ export default {
} }
], ],
tableSearchForm: {}, tableSearchForm: {},
searchFormData: [
{
label: '客户名称',
name: 'codeNameAndRemark',
type: 'input',
placeholder: '请输入客户名称'
},
{
label: '状态',
name: 'imStatus',
type: 'select',
placeholder: '请选择',
optionId: 'value',
optionLabel: 'label',
optionList: [
{
value: '',
label: '全部'
},
{
value: '0',
label: '正常'
},
{
value: '-1',
label: '删除好友'
}
]
},
{
label: '跟进员工',
name: 'imStatus',
type: 'select',
placeholder: '请选择',
optionId: 'value',
optionLabel: 'label',
optionList: [
{
value: '',
label: '全部'
},
{
value: '0',
label: '正常'
},
{
value: '-1',
label: '删除好友'
}
]
},
{
label: '添加时间',
name: 'createTime',
type: 'datePicker',
placeholder: '',
isClear: true,
pickerOptions: {
disabledDate: time => {
return time.getTime() > Date.now()
}
}
}
],
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' }, pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
tableParams: { tableParams: {
listName: 'data', listName: 'data',
...@@ -89,22 +154,22 @@ export default { ...@@ -89,22 +154,22 @@ export default {
console.log(cellValue) console.log(cellValue)
return cellValue.customerSex == 1 ? '男' : '女' return cellValue.customerSex == 1 ? '男' : '女'
}, },
width: '80px', width: '80px'
}, },
{ {
label: '状态', label: '状态',
prop: 'status', prop: 'status',
addHtml: 'status', addHtml: 'status',
width: '80px', width: '80px'
}, },
{ {
label: '跟进员工', label: '跟进员工',
prop: 'followStaff', prop: 'followStaff',
width: '80px', width: '80px'
}, },
{ {
label: '添加时间', label: '添加时间',
prop: 'addTime', prop: 'addTime'
}, },
{ {
label: '操作', label: '操作',
...@@ -168,7 +233,7 @@ export default { ...@@ -168,7 +233,7 @@ export default {
this.createTime = [] this.createTime = []
this.pStatus = null this.pStatus = null
this.staffIds = null this.staffIds = null
this.timeStatus = true; this.timeStatus = true
if (value == 'day' && !day) { if (value == 'day' && !day) {
this.createTime = [util.getDay(0), util.getDay(0)] this.createTime = [util.getDay(0), util.getDay(0)]
this.timeStatus = false this.timeStatus = false
...@@ -221,12 +286,12 @@ export default { ...@@ -221,12 +286,12 @@ export default {
handleDetail(scope) { handleDetail(scope) {
this.$history.push('/custom/clientManage/clientDetail?id=' + scope.oneId) this.$history.push('/custom/clientManage/clientDetail?id=' + scope.oneId)
}, },
handleCancel: utils.debounce(function () { handleCancel: utils.debounce(function() {
this.dialogVisible = false this.dialogVisible = false
}, 300) }, 300)
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.dialog-jump { .dialog-jump {
...@@ -238,7 +303,8 @@ export default { ...@@ -238,7 +303,8 @@ export default {
} }
.emp-form { .emp-form {
/deep/ { /deep/ {
.el-date-editor,.el-input { .el-date-editor,
.el-input {
width: 215px; width: 215px;
} }
} }
...@@ -267,4 +333,4 @@ export default { ...@@ -267,4 +333,4 @@ export default {
vertical-align: middle; vertical-align: middle;
} }
} }
</style>
\ No newline at end of file \ No newline at end of file
</style>
<template> <template>
<div class="square-main"> <div class="square-main">
<el-dialog title="选择渠道" :visible.sync="dialogVisible" width="70%" :before-close="handleCancel"> <GLDialog title="选择渠道" :visible.sync="dialogVisible" @onOk="handleSelect" @onCancel="handleCancel" mode="big">
<div class="square-tabel"> <div class="square-tabel">
<div class="square-tabel-select"> <div class="square-tabel-select">
<GLTable ref="table" :hasPage="false" :tableData="tableData" :tableTotal="tableTotal" :tableParams="tableParams" @refreshTable="handleSearch" @selectionTable="selectionTable"></GLTable> <GLTable ref="table" :hasPage="false" :tableData="tableData" :tableTotal="tableTotal" :tableParams="tableParams" @refreshTable="handleSearch" @selectionTable="selectionTable"></GLTable>
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<div class="selected-panel"> <div class="selected-panel">
<div class="selected-item" v-for="(item, index) in selectedList" :key="index"> <div class="selected-item" v-for="(item, index) in selectedList" :key="index">
<div :title="item.codeName"> <div :title="item.codeName">
<span :style="{ background: colorList[index]}"></span> <span :style="{ background: colorList[index] }"></span>
{{ item.codeName }} {{ item.codeName }}
</div> </div>
<img src="@/assets/img/channel/del.png" @click="delTag(item)" /> <img src="@/assets/img/channel/del.png" @click="delTag(item)" />
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<el-button size="small" @click="handleCancel">取 消</el-button> <el-button size="small" @click="handleCancel">取 消</el-button>
<el-button size="small" type="primary" @click="handleSelect">确 定</el-button> <el-button size="small" type="primary" @click="handleSelect">确 定</el-button>
</span> </span>
</el-dialog> </GLDialog>
</div> </div>
</template> </template>
...@@ -104,7 +104,7 @@ export default { ...@@ -104,7 +104,7 @@ export default {
this.dialogVisible = false this.dialogVisible = false
this.$refs.table.$refs.salelistMutiTable.clearSelection() this.$refs.table.$refs.salelistMutiTable.clearSelection()
}, },
handleSelect: utils.debounce(function () { handleSelect: utils.debounce(function() {
if (this.selectedList.length == 0) { if (this.selectedList.length == 0) {
this.$message.error('请选择渠道') this.$message.error('请选择渠道')
return return
...@@ -119,7 +119,7 @@ export default { ...@@ -119,7 +119,7 @@ export default {
}, 300) }, 300)
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.square-main { .square-main {
...@@ -154,11 +154,11 @@ export default { ...@@ -154,11 +154,11 @@ export default {
white-space: nowrap; white-space: nowrap;
} }
span { span {
vertical-align: middle; vertical-align: middle;
display: inline-block; display: inline-block;
width: 12px; width: 12px;
height: 2px; height: 2px;
margin-right: 10px; margin-right: 10px;
} }
img { img {
width: 16px; width: 16px;
...@@ -182,4 +182,4 @@ export default { ...@@ -182,4 +182,4 @@ export default {
} }
} }
} }
</style>
\ No newline at end of file \ No newline at end of file
</style>
<template> <template>
<div class="channel-main"> <div class="channel-main">
{{aaa}}
<el-tabs v-model="activeName" @tab-click="handleClick"> <el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="渠道码列表" name="first"></el-tab-pane> <el-tab-pane label="渠道码列表" name="first"></el-tab-pane>
<el-tab-pane label="数据统计" name="second"></el-tab-pane> <el-tab-pane label="数据统计" name="second"></el-tab-pane>
...@@ -26,7 +25,7 @@ export default { ...@@ -26,7 +25,7 @@ export default {
}, },
methods: { methods: {
jumpWx() { jumpWx() {
this.$history.push('/home/enterpriseWechat/index') this.$history.push('/settings/enterpriseWechat/index')
}, },
wxTips() { wxTips() {
const menu = JSON.parse(sessionStorage['SCRM_BASE_MENULIST']) const menu = JSON.parse(sessionStorage['SCRM_BASE_MENULIST'])
...@@ -59,7 +58,7 @@ export default { ...@@ -59,7 +58,7 @@ export default {
this.wxTips() this.wxTips()
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.channel-main { .channel-main {
...@@ -69,4 +68,4 @@ export default { ...@@ -69,4 +68,4 @@ export default {
} }
} }
} }
</style>
\ No newline at end of file \ No newline at end of file
</style>
<template> <template>
<div class="channel-main scrm-box-f" v-loading="loading"> <div class="channel-main scrm-box-f" v-loading="loading">
<div class="channel-header">
<el-button type="primary" size="small" @click="goBack">返回</el-button>
</div>
<div class="poster-body"> <div class="poster-body">
<div class="poster-item" @click="setPoster(item)" @mouseenter="item.show = true" @mouseleave="item.show = false" v-for="(item, index) in posterList" :key="index"> <div class="poster-item" @click="setPoster(item)" @mouseenter="item.show = true" @mouseleave="item.show = false" v-for="(item, index) in posterList" :key="index">
<div class="poster-del" v-show="item.show" @click.stop="handleDelete(item.id)"> <div class="poster-del" v-show="item.show" @click.stop="handleDelete(item.id)">
...@@ -10,7 +7,7 @@ ...@@ -10,7 +7,7 @@
</div> </div>
<div class="poster-item-box" v-loading="item.loadingImg"> <div class="poster-item-box" v-loading="item.loadingImg">
<img <img
:src="item.thumbnailUrl?item.thumbnailUrl:item.autoUrl" :src="item.thumbnailUrl ? item.thumbnailUrl : item.autoUrl"
class="poster-image" class="poster-image"
v-if="item.imgWidth" v-if="item.imgWidth"
:style="{ :style="{
...@@ -36,7 +33,7 @@ ...@@ -36,7 +33,7 @@
</div> </div>
</div> </div>
</div> </div>
<el-dialog v-loading="loadingDrag" title="创建活码海报" :visible.sync="dialogVisible" width="50%" :before-close="handleClose"> <GLDialog @onOk="savePoster" @onCancel="dialogVisible = false" v-loading="loadingDrag" title="创建活码海报" :visible.sync="dialogVisible">
<div class="poster-draggable-title">拖动活码可调整活码位置</div> <div class="poster-draggable-title">拖动活码可调整活码位置</div>
<div class="poster-draggable"> <div class="poster-draggable">
<div <div
...@@ -66,11 +63,11 @@ ...@@ -66,11 +63,11 @@
></vue-draggable-resizable> ></vue-draggable-resizable>
</div> </div>
</div> </div>
<span slot="footer" class="dialog-footer"> <!-- <span slot="footer" class="dialog-footer">
<el-button size="small" @click="dialogVisible = false">取 消</el-button> <el-button size="small" @click="dialogVisible = false">取 消</el-button>
<el-button size="small" type="primary" @click="savePoster">确 定</el-button> <el-button size="small" type="primary" @click="savePoster">确 定</el-button>
</span> </span> -->
</el-dialog> </GLDialog>
</div> </div>
</template> </template>
...@@ -179,7 +176,7 @@ export default { ...@@ -179,7 +176,7 @@ export default {
} else { } else {
self.loading = false self.loading = false
} }
self.$refs.file.value = ''; self.$refs.file.value = ''
}) })
} }
} }
...@@ -232,13 +229,13 @@ export default { ...@@ -232,13 +229,13 @@ export default {
listChannelCodeBill.forEach(item => { listChannelCodeBill.forEach(item => {
item.show = false item.show = false
item.loadingImg = true item.loadingImg = true
let backUrl = item.thumbnailUrl?item.thumbnailUrl: item.autoUrl let backUrl = item.thumbnailUrl ? item.thumbnailUrl : item.autoUrl
this.backUrl = backUrl this.backUrl = backUrl
let img = new Image() let img = new Image()
img.src = backUrl img.src = backUrl
this.loadingImg = true this.loadingImg = true
this.loadingDrag = false this.loadingDrag = false
img.onload = function () { img.onload = function() {
if (img.width > img.height) { if (img.width > img.height) {
item.imgWidth = 280 item.imgWidth = 280
item.imgHeight = (img.height * 280) / img.width item.imgHeight = (img.height * 280) / img.width
...@@ -256,7 +253,7 @@ export default { ...@@ -256,7 +253,7 @@ export default {
let img = new Image() let img = new Image()
img.src = img_url img.src = img_url
let self = this let self = this
img.onload = function () { img.onload = function() {
self.dragHeight = (img.height * 375) / img.width self.dragHeight = (img.height * 375) / img.width
self.dialogVisible = true self.dialogVisible = true
self.loading = false self.loading = false
...@@ -268,7 +265,7 @@ export default { ...@@ -268,7 +265,7 @@ export default {
this.getPoster() this.getPoster()
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.channel-main { .channel-main {
...@@ -384,4 +381,4 @@ export default { ...@@ -384,4 +381,4 @@ export default {
} }
} }
} }
</style>
\ No newline at end of file \ No newline at end of file
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!