main
hcj 3 months ago
parent c228536503
commit 2d71c360e9
  1. 4
      .env.production
  2. 21
      .eslintrc.js
  3. 15
      .prettierrc.js
  4. BIN
      pc_prod.zip
  5. BIN
      pc_test.zip
  6. BIN
      public/assets/home/bannernew3.jpg
  7. BIN
      public/assets/home/bannernew3.png
  8. 2
      public/index.html
  9. 4
      src/api/my/testb.js
  10. 25
      src/api/pay/index.js
  11. 47
      src/api/train/index.js
  12. 4
      src/components/myUpload/index.vue
  13. 54
      src/main.js
  14. 2
      src/page/common/mobileTip.vue
  15. 1
      src/page/common/myUpload.vue
  16. 2
      src/page/homepage/crowdsourcing/crowddetails.vue
  17. 2
      src/page/homepage/home/home.vue
  18. 2
      src/page/homepage/personability/abilityApply.vue
  19. 38
      src/page/homepage/tool/tooldetails.vue
  20. 3
      src/page/homepage/tool/toolmarker.vue
  21. 22
      src/page/homepage/traininstitute/train.vue
  22. 2
      src/page/personalpage/commonheader/personalheader.vue
  23. 140
      src/page/personalpage/course/index.vue
  24. 340
      src/page/personalpage/course/onLineCourse.vue
  25. 37
      src/page/personalpage/myBm/index.vue
  26. 577
      src/page/personalpage/testmanagement/mytask.vue
  27. 7
      src/page/personalpage/testmanagement/mytool.vue
  28. 422
      src/page/personalpage/testtool/myorder.vue
  29. 2
      src/page/personalpage/testtreasure/testKit.vue
  30. 137
      src/router/router.js
  31. 38
      src/store/modules/dict.js
  32. 9
      src/style/index.scss
  33. 0
      src/style/reset.scss
  34. 3
      src/style/variable.scss
  35. 15
      src/util/pdfDownLoad.js
  36. 2
      src/util/scroll-to.js
  37. 503
      src/util/util.js

@ -9,6 +9,6 @@ VUE_APP_BASE_API = '/prod-api'
# VUE_APP_BASE_TARGET = 'https://www.keyitest.cn/prod-api'
# VUE_APP_BASE_TARGET = 'http://www.bjkeyware.com/test-api'
# VUE_APP_BASE_TARGET = 'https://www.bjkeyware.com/prod-api'
VUE_APP_BASE_TARGET = 'https://www.bjkeyware.com/prod-api'
VUE_APP_BASE_TARGET = 'http://192.168.0.229:9999/prod-api'
# VUE_APP_BASE_TARGET = 'http://192.168.0.229:9999/prod-api'

@ -0,0 +1,21 @@
module.exports = {
root: true,
env: {
node: true,
es6: true,
browser: true
},
extends: ['plugin:vue/essential', 'eslint:recommended', 'plugin:prettier/recommended'],
parserOptions: {
parser: 'babel-eslint'
},
globals: {
envConfig: 'readable'
},
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-unused-vars': 0,
'vue/no-mutating-props': 0
}
}

@ -0,0 +1,15 @@
module.exports = {
printWidth: 120, // 一行最多 120 字符(默认80)
tabWidth: 2, // 每个tab相当于多少个空格(默认2)
useTabs: false, // 是否使用tab进行缩进(默认false)
semi: false, // 行尾需要有分号(默认true)
singleQuote: true, // 使用单引号(默认false)
quoteProps: 'as-needed', // 对象的 key 仅在必要时用引号
jsxSingleQuote: false, // jsx 不使用单引号,而使用双引号
trailingComma: 'none', // 多行使用拖尾逗号(默认none)
bracketSpacing: true, // 在对象,数组括号与文字之间加空格 "{ foo: bar }"(默认true)
jsxBracketSameLine: false, // 多行JSX中的>放置在最后一行的结尾,而不是另起一行(默认false)
htmlWhitespaceSensitivity: 'css', // 根据显示样式决定 html 要不要折行
arrowParens: 'avoid', // 只有一个参数的箭头函数的参数是否带圆括号(默认avoid:添加括号)
endOfLine: 'auto' // 行尾换行符
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 190 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 869 KiB

@ -7,7 +7,7 @@
<meta content="一站式软件测试云平台, 融合软件测试工具市场, 软件测试SaaS平台, 测试任务众包云平台, 软件测试培训学院, 软件测试人员外包平台,以及软件测试行业动态" name="description">
<meta content="关键测试, lovecode, lovecode.cc, 软件测试, 测试云平台, 测试工具市场, 软件测试SaaS, 测试任务众包, 测试培训, 测试人员外包" name="keywords">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title>关键测试</title>
<title>小关软测</title>
<!-- <script>
var _hmt = _hmt || [];
(function() {

@ -1,13 +1,13 @@
import request from '../request'
//用户查看自己的测宝账号信息
//用户查看自己的测宝账号信息
export function queryAccount(userId) {
return request({
url: '/mpay/my/account/'+userId,
method: 'get'
})
}
//用户查看自己的测宝交易记录
//用户查看自己的测宝交易记录
export function queryRecord(userId,query) {
return request({
url: '/mpay/my/record/'+userId,

@ -1,23 +1,19 @@
import request from "../request";
import request from '../request'
export function orderPay(data) {
return request({
url: '/play/allin_play',
method: 'post',
data,
data
})
}
// 轮训查订单状态
export function searchOrderStatus(query) {
return request({
url: '/play/query_order_status',
method: 'get',
params: query,
params: query
})
}
@ -26,8 +22,15 @@ export function searchMyMoney(query) {
return request({
url: '/play/money_yes_or_no',
method: 'get',
params: query,
params: query
})
}
}
// 待支付订单
export function waitOrderToPay(data) {
return request({
url: '/play/wait_play',
method: 'post',
data
})
}

@ -1,11 +1,11 @@
import request from "../request";
import request from '../request'
// 报名
export function postBaoming(data) {
return request({
url: '/train/training/apply',
method: 'post',
data,
data
})
}
@ -20,24 +20,21 @@ export function postBaomingNoToken(data) {
})
}
export function getSignUpList(query) {
return request({
url: `/train/trainClassList`,
method: 'get',
params: query,
params: query
})
}
export function getmySignUpList(query) {
return request({
url: `/train/myTrainingList`,
method: 'get',
params: query,
params: query
})
}
// 班级列表get /train/portal
export function getClassList(query) {
return request({
@ -97,7 +94,7 @@ export function getSwiperImages() {
}
// 根据班级id查询所有课程
export function getCourse(params,id) {
export function getCourse(params, id) {
return request({
url: '/course/myCourse/class/' + id,
method: 'get',
@ -113,4 +110,38 @@ export function uploadEndClassReport(data) {
data
})
}
// 获取线上课程内容
export function getOnlineCourse(id) {
return request({
url: '/course/online/course/' + id,
method: 'get',
headers: {
isToken: false
}
})
}
//
export function subPass(id, pass) {
return request({
url: '/train/course/enterPasswd/' + id,
method: 'post',
data: { password: pass }
})
}
// 输入口令获取课程链接
export function submitPassWord(pass) {
return request({
url: '/train/course/enterPasswd/' + pass,
method: 'post'
})
}
// 扫码付款
export function payForOnlineCourse(data) {
return request({
url: '/play/course/pay',
method: 'post',
data
})
}

@ -42,10 +42,10 @@ export default {
this.name = file.name
const filetype = file.name.slice(file.name.lastIndexOf('.', file.name.length))
console.log(filetype);
const isType = ['.doc', '.docx'].some(item => { return item == filetype })
const isType = ['.doc', '.docx','.pdf'].some(item => { return item == filetype })
console.log(isType);
if (!isType) {
this.$message.error('只能上传doc、docx格式文件!');
this.$message.error('只能上传doc、docx、pdf格式文件!');
return false
}
}

@ -1,41 +1,50 @@
import Vue from 'vue'
import App from './App.vue'
import router from './router/router'
import Vconsole from 'vconsole';
import Vconsole from 'vconsole'
import store from './store/index'
import axios from './api/request'
import 'babel-polyfill'// 保证在IE浏览器打开
import 'babel-polyfill' // 保证在IE浏览器打开
//以上三行不要动保存原来的位置
//原因:引入有顺序
//第三方组件库在下面引入
//1.完整引入mint-ui
import MintUI from 'mint-ui'
//2.单独引入mint-ui样式
import'mint-ui/lib/style.css'
import ElementUI from 'element-ui'; //完整引入ElementUI
import 'element-ui/lib/theme-chalk/index.css';//单独引入element-ui样式
import 'mint-ui/lib/style.css'
import ElementUI from 'element-ui' //完整引入ElementUI
import 'element-ui/lib/theme-chalk/index.css' //单独引入element-ui样式
import '@/style/index.scss'
import Distpicker from 'v-distpicker' //城市选择器
import htmlpanel from '@/page/common/htmlpanel' //展示外部链接
// 复制插件
import VueClipboard from 'vue-clipboard2';
Vue.use(VueClipboard);
import VueClipboard from 'vue-clipboard2'
Vue.use(VueClipboard)
// 全局禁止log日志
// console.log = function() {
// };
// xss攻击
import Xss from 'xss'
Vue.prototype.Xss = Xss
//全局引入方法,页面this.直接使用
import { getConfigKey, getClientConfigKey } from "@/api/system/config";
import { currency,parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, download, downloadHttp, downloadFast, handleTree } from "@/util/util";
import xss from 'xss';
import { getConfigKey, getClientConfigKey } from '@/api/system/config'
import {
currency,
parseTime,
resetForm,
addDateRange,
selectDictLabel,
selectDictLabels,
download,
downloadHttp,
downloadFast,
handleTree
} from '@/util/util'
import xss from 'xss'
// 控制台
// new Vconsole();
Vue.component('v-distpicker', Distpicker)
@ -49,20 +58,21 @@ Vue.prototype.selectDictLabel = selectDictLabel
Vue.prototype.selectDictLabels = selectDictLabels
Vue.prototype.download = download
Vue.prototype.handleTree = handleTree
window.downloadFast = downloadFast;
window.downloadHttp = downloadHttp;
Vue.prototype.downloadFast = downloadFast;
Vue.prototype.downloadHttp = downloadHttp;
window.downloadFast = downloadFast
window.downloadHttp = downloadHttp
Vue.prototype.downloadFast = downloadFast
Vue.prototype.downloadHttp = downloadHttp
//过滤器全局名称,对应过滤函数方法名
Vue.filter("currency",currency)
Vue.filter('currency', currency)
//3.将mint-ui注册vue
Vue.use(MintUI);
Vue.use(ElementUI);
Vue.use(MintUI)
Vue.use(ElementUI)
Vue.config.productionTip = false
const app = new Vue({
router,store,axios,
router,
store,
axios,
render: h => h(App)
}).$mount('#app')

@ -1,7 +1,7 @@
<template>
<div class="mobileWrap">
<div class="tipText">
<p>关键测试宝pc端</p>
<p>小关软测宝pc端</p>
<p>请使用电脑浏览器访问</p>
</div>
<div class="urlCopy">

@ -20,7 +20,6 @@
>
<template v-if="fileName == '步骤照片' || fileName == '文档' || fileName == '附件上传'">
<el-button
size="small"
type="primary"
>点击上传</el-button

@ -335,7 +335,7 @@
<el-dialog :visible.sync="resultOpen" width="500px" :close-on-click-modal="false" append-to-body>
<div>
<p>竞标信息已提交竞标结果会通过网页站内消息通知</p>
<p>也可以扫码登录微信小程序关键测试实时查看站内消息通知</p>
<p>也可以扫码登录微信小程序小关软测实时查看站内消息通知</p>
<img style="width: 150px; height: 150px; margin-left: 150px" src="/assets/homepage/xcx.jpg" alt="" />
</div>
<span slot="footer" class="dialog-footer">

@ -557,7 +557,7 @@ export default {
return {
bannerHeight: '500',
indexbanner: [
{ id: 2, imgurl: '/assets/home/bannernew3.png', url: '/crowdsourcing' },
{ id: 2, imgurl: '/assets/home/bannernew3.jpg', url: '/crowdsourcing' },
],
toolslist: [], //
toolload: true,

@ -97,7 +97,7 @@
<div class="activeTitLine"></div>
实名认证
</div>
<div class="applytip">请放心认证关键测试宝平台承诺保障你的个人信息安全</div>
<div class="applytip">请放心认证小关软测宝平台承诺保障你的个人信息安全</div>
<div class="workIt">
<el-form ref="certifform" :model="certifform" :rules="certifRules">
<el-form-item prop="name">

@ -113,7 +113,8 @@
<img style="margin-right: 10px; vertical-align: bottom" src="/assets/tool/pdf.png"
alt="" />下载软件包
</p>
<el-button class="downBtn" @click="warnBuy">{{ (tool.package.indexOf('http') == '-1') ? '下载' :'复制下载链接' }}
<el-button class="downBtn" @click="warnBuy">{{ (tool.package.indexOf('http') == '-1') ? '下载'
: '复制下载链接' }}
<i class="el-icon-copy-document" v-if="tool.package.indexOf('http') != '-1'"></i>
<i class="el-icon-download" v-else></i>
</el-button>
@ -173,6 +174,7 @@
<el-option v-if="buyTool.deliverType == 'SaaS'" label="测试服务(按次计)" value="测试服务(按次计)">
</el-option>
<el-option label="使用时长(按月计)" value="使用时长(按月计)"> </el-option>
<el-option label="线下测试服务(金额面议)" value="线下测试服务(金额面议)"> </el-option>
</el-select>
<!-- {{ buyTool.deliverType == 'License' ? '按月' : '按次' }} -->
@ -180,6 +182,7 @@
<el-form-item label="商品价格:">
<span v-if="serviceType == '测试服务(按次计)' && buyTool.priceTime == 0">限时免费</span>
<span v-else-if="serviceType == '使用时长(按月计)' && buyTool.price == 0">限时免费</span>
<span v-else-if="serviceType == '线下测试服务(金额面议)'">金额面议</span>
<span v-else>{{ serviceType == '测试服务(按次计)' ? buyTool.priceTime : buyTool.price }}</span>
</el-form-item>
<el-form-item label="购买数量:">
@ -195,7 +198,8 @@
</el-form-item>
<el-form-item label="应付金额:">
<span style="font-weight: bold; font-size: 22px; color: #fd461a">
<span v-if="addPriceAll == 0">限时免费</span>
<span v-if="addPriceAll == 0 && serviceType != '线下测试服务(金额面议)'">限时免费</span>
<span v-else-if="serviceType == '线下测试服务(金额面议)'">金额面议</span>
<span v-else> {{ addPriceAll }}</span>
</span>
</el-form-item>
@ -216,6 +220,7 @@
</el-form>
<div class="joinpurch123">
<el-button @click="immediatelypay">立即支付</el-button>
<!-- <el-button @click="offline">确定</el-button> -->
</div>
</el-dialog>
<el-dialog title="待支付" :visible.sync="boxShow" width="600px" :before-close="handleClose" class="qcode"
@ -266,6 +271,7 @@ import { orderPay, searchOrderStatus, searchMyMoney } from '@/api/pay/index.js'
import { queryAccount } from '@/api/my/testb.js'
import { encrypt } from '@/util/encrypt'
import downPdf from '../../../util/pdfDownLoad'
export default {
props: ['mydetails'],
data() {
@ -346,7 +352,8 @@ export default {
this.tool.vedio = it.fileUrl
} else if (it.fileType == 'package') {
// package
this.tool.package = it.fileUrl
// this.tool.package = it.fileUrl
this.tool.package = it.filePath
} else if (it.fileType == 'instructionManual') {
// instructionManual
this.tool.instructionManual = it.fileUrl
@ -469,7 +476,8 @@ export default {
})
.catch(() => { })
} else {
this.tool.instructionManual && window.open(this.tool.instructionManual, '_self')
// this.tool.instructionManual && window.open(this.tool.instructionManual, '_self')
this.tool.instructionManual && downPdf(this.tool.instructionManual)
}
},
//
@ -485,7 +493,8 @@ export default {
})
.catch(() => { })
} else {
this.tool.userGuide && window.open(this.tool.userGuide, '_self')
downPdf(this.tool.userGuide)
// this.tool.userGuide && window.open(this.tool.userGuide, '_self')
}
},
//
@ -576,6 +585,9 @@ export default {
closeCode() {
clearInterval(this.orderTimers)
},
// offline() {
// },
//
immediatelypay() {
let param = {}
@ -588,6 +600,22 @@ export default {
param.toolType = this.buyTool.toolType
param.userId = this.userinform.userId
param.priceType = this.serviceType == '使用时长(按月计)' ? 'month' : 'times'
// 线
if (this.serviceType == '线下测试服务(金额面议)') {
param.price = 0
param.priceType = 'offLine'
noPayBuy(param).then((response) => {
this.paydiaopen = false
this.$notify({
title: '线下测试服务产品购买成功',
message: '请联系商务人员-张女士13581546592',
align: 'center',
type: 'success',
customClass: 'contactMissZhang'
})
})
return
}
//0
if (param.price == 0) {
noPayBuy(param).then((response) => {

@ -174,12 +174,11 @@ export default {
this.loading = true
// console.log('toolType----'.this.toolType)
let data = {
toolType: this.toolType,
toolType: this.typeName,
deliverType: this.deliverType,
pageNum: this.pageNum,
pageSize: this.pageSize,
status: 1,
typeName:this.typeName
}
Object.keys(data).forEach((keyd) => {
if (!data[keyd] || data[keyd] == '' || data[keyd] == '0' || data[keyd] == "''") {

@ -599,7 +599,7 @@ export default {
pxnr: '单元测试、配置项测试、安全性测试、可编程逻辑器件测试课程学习。',
sh: '1.进入北京关键科技股份有限公司人才库且获得工业和信息化人才岗位能力评价证书。',
sh1: '2.考核成绩优秀者可推荐进入北京关键科技股份有限公司或者合作单位实习。',
sh2: '3.可以在北京关键科技股份有限公司的关键测试宝平台承接测试任务。',
sh2: '3.可以在北京关键科技股份有限公司的小关软测宝平台承接测试任务。',
sh3: '4.可以去学校配合讲师当助教,进一步加强自身学习。',
},
{
@ -611,7 +611,7 @@ export default {
pxnr: '单元测试、配置项测试、安全性测试、可编程逻辑器件测试课程学习。',
sh: '1.进入北京关键科技股份有限公司人才库且获得工业和信息化人才岗位能力评价证书。',
sh1: '2.考核成绩优秀者可推荐进入北京关键科技股份有限公司或者合作单位实习。',
sh2: '3.可以在北京关键科技股份有限公司的关键测试宝平台承接测试任务。',
sh2: '3.可以在北京关键科技股份有限公司的小关软测宝平台承接测试任务。',
sh3: '4.可以去学校配合讲师当助教,进一步加强自身学习。',
},
{
@ -623,7 +623,7 @@ export default {
pxnr: '单元测试、配置项测试、安全性测试、可编程逻辑器件测试课程学习。',
sh: '1.进入北京关键科技股份有限公司人才库且获得工业和信息化人才岗位能力评价证书。',
sh1: '2.考核成绩优秀者可推荐进入北京关键科技股份有限公司或者合作单位实习。',
sh2: '3.可以在北京关键科技股份有限公司的关键测试宝平台承接测试任务。',
sh2: '3.可以在北京关键科技股份有限公司的小关软测宝平台承接测试任务。',
sh3: '4.可以去学校配合讲师当助教,进一步加强自身学习。',
},
{
@ -635,7 +635,7 @@ export default {
pxnr: '单元测试、配置项测试、安全性测试、可编程逻辑器件测试课程学习。',
sh: '1.进入北京关键科技股份有限公司人才库且获得工业和信息化人才岗位能力评价证书。',
sh1: '2.考核成绩优秀者可推荐进入北京关键科技股份有限公司或者合作单位实习。',
sh2: '3.可以在北京关键科技股份有限公司的关键测试宝平台承接测试任务。',
sh2: '3.可以在北京关键科技股份有限公司的小关软测宝平台承接测试任务。',
sh3: '4.可以去学校配合讲师当助教,进一步加强自身学习。',
},
{
@ -647,7 +647,7 @@ export default {
pxnr: '单元测试、配置项测试、安全性测试、可编程逻辑器件测试课程学习。',
sh: '1.进入北京关键科技股份有限公司人才库且获得工业和信息化人才岗位能力评价证书。',
sh1: '2.考核成绩优秀者可推荐进入北京关键科技股份有限公司或者合作单位实习。',
sh2: '3.可以在北京关键科技股份有限公司的关键测试宝平台承接测试任务。',
sh2: '3.可以在北京关键科技股份有限公司的小关软测宝平台承接测试任务。',
sh3: '4.可以去学校配合讲师当助教,进一步加强自身学习。',
},
{
@ -659,7 +659,7 @@ export default {
pxnr: '单元测试、配置项测试、安全性测试、可编程逻辑器件测试课程学习。',
sh: '1.进入北京关键科技股份有限公司人才库且获得工业和信息化人才岗位能力评价证书。',
sh1: '2.考核成绩优秀者可推荐进入北京关键科技股份有限公司或者合作单位实习。',
sh2: '3.可以在北京关键科技股份有限公司的关键测试宝平台承接测试任务。',
sh2: '3.可以在北京关键科技股份有限公司的小关软测宝平台承接测试任务。',
sh3: '4.可以去学校配合讲师当助教,进一步加强自身学习。',
},
{
@ -671,7 +671,7 @@ export default {
pxnr: '单元测试、配置项测试、安全性测试、可编程逻辑器件测试课程学习。',
sh: '1.进入北京关键科技股份有限公司人才库且获得工业和信息化人才岗位能力评价证书。',
sh1: '2.考核成绩优秀者可推荐进入北京关键科技股份有限公司或者合作单位实习。',
sh2: '3.可以在北京关键科技股份有限公司的关键测试宝平台承接测试任务。',
sh2: '3.可以在北京关键科技股份有限公司的小关软测宝平台承接测试任务。',
sh3: '4.可以去学校配合讲师当助教,进一步加强自身学习。',
},
{
@ -683,7 +683,7 @@ export default {
pxnr: '单元测试、配置项测试、安全性测试、可编程逻辑器件测试课程学习。',
sh: '1.进入北京关键科技股份有限公司人才库且获得工业和信息化人才岗位能力评价证书。',
sh1: '2.考核成绩优秀者可推荐进入北京关键科技股份有限公司或者合作单位实习。',
sh2: '3.可以在北京关键科技股份有限公司的关键测试宝平台承接测试任务。',
sh2: '3.可以在北京关键科技股份有限公司的小关软测宝平台承接测试任务。',
sh3: '4.可以去学校配合讲师当助教,进一步加强自身学习。',
},
{
@ -695,7 +695,7 @@ export default {
pxnr: '单元测试、配置项测试、安全性测试、可编程逻辑器件测试课程学习。',
sh: '1.进入北京关键科技股份有限公司人才库且获得工业和信息化人才岗位能力评价证书。',
sh1: '2.考核成绩优秀者可推荐进入北京关键科技股份有限公司或者合作单位实习。',
sh2: '3.可以在北京关键科技股份有限公司的关键测试宝平台承接测试任务。',
sh2: '3.可以在北京关键科技股份有限公司的小关软测宝平台承接测试任务。',
sh3: '4.可以去学校配合讲师当助教,进一步加强自身学习。',
},
{
@ -707,7 +707,7 @@ export default {
pxnr: '单元测试、配置项测试、安全性测试、可编程逻辑器件测试课程学习。',
sh: '1.进入北京关键科技股份有限公司人才库且获得工业和信息化人才岗位能力评价证书。',
sh1: '2.考核成绩优秀者可推荐进入北京关键科技股份有限公司或者合作单位实习。',
sh2: '3.可以在北京关键科技股份有限公司的关键测试宝平台承接测试任务。',
sh2: '3.可以在北京关键科技股份有限公司的小关软测宝平台承接测试任务。',
sh3: '4.可以去学校配合讲师当助教,进一步加强自身学习。',
},
{
@ -719,7 +719,7 @@ export default {
pxnr: '单元测试、配置项测试、安全性测试、可编程逻辑器件测试课程学习。',
sh: '1.进入北京关键科技股份有限公司人才库且获得工业和信息化人才岗位能力评价证书。',
sh1: '2.考核成绩优秀者可推荐进入北京关键科技股份有限公司或者合作单位实习。',
sh2: '3.可以在北京关键科技股份有限公司的关键测试宝平台承接测试任务。',
sh2: '3.可以在北京关键科技股份有限公司的小关软测宝平台承接测试任务。',
sh3: '4.可以去学校配合讲师当助教,进一步加强自身学习。',
},
{

@ -14,7 +14,7 @@
<!-- <img @click="tishou" style="cursor:pointer;height:45px;object-fit:contain" src="/assets/loginreg/logo.png" alt=""> -->
<p @click="tishou" style="font-weight: bold; color: #262626; cursor: pointer; font-size: 20px">
<img src="/assets/loginreg/logo1.png" style="width: 20px; vertical-align: middle" alt="" />
关键测试
小关软测
</p>
<!-- <el-radio-group v-model="isCollapse" style="margin-bottom: 20px;">
<el-radio-button type='text' :label="false">展开</el-radio-button>

@ -3,9 +3,15 @@
<div class="courseItemWrap" v-if="courseList.length">
<div class="courseItem" v-for="course in courseList" :key="course.courseId">
<div class="courseName">
<div>{{ course.courseName }}</div>
<div v-if="course.status" class="signInLog">已签到</div>
<div v-else class="signInLog" style="background: #a8aeb6">未签到</div>
<div :class="(classType == 4) && 'onLine'" @click="toLearn(course)">{{ course.courseName }}</div>
<div v-if="course.status && classType != 4" class="signInLog">已签到</div>
<div v-if="toLearnShow(course) == '1'" class="signInLog toLearn" @click="toLearn(course, '1')">去学习
</div>
<div v-if="toLearnShow(course) == '2'" class="signInLog toPay" @click="toLearn(course)"
style="padding: 0 10px;">
{{ `付费学习¥${course.amount}` }}
</div>
<div v-if="!course.status && classType != 4" class="signInLog" style="background: #a8aeb6">未签到</div>
</div>
<div class="courseTime">
<div>上课时间: {{ course.courseTime }}</div>
@ -17,28 +23,56 @@
</div>
</div>
</div>
<div v-else class="noCourse">暂未配置课程</div>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="init"
/>
<el-dialog title="复制学习链接" :visible.sync="dialogVisible" width="600px" class="freeDialog">
<el-divider></el-divider>
<div class="copyLearnLink">
<div>学习链接</div>
<div style="margin: 1px">请使用腾讯会议打开</div>
<div>{{ currentCourse.url }}</div>
<el-button style="
margin-top: 20px;
width: 250px;height: 44px;background: linear-gradient(90deg, #5EA6FD, #1A81F9);border-radius: 22px;"
type="primary" @click="copy(currentCourse.url)">复制</el-button>
</div>
</el-dialog>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize" @pagination="init" />
</div>
</template>
<script>
import { getCourse } from '@/api/train/index.js'
import Pagination from "@/components/Pagination";
import copyText from '../../../util/cpoyText';
export default {
created() {
this.classType = this.$route.query.classType
this.init()
},
components:{
components: {
Pagination
},
computed: {
toLearnShow() {
return (course) => {
if (this.classType != 4) {
return '0'
}
console.log(course);
if (course.isPay == '0') {
return '1'
} else if (course.remark.indexOf(course.courseId) != -1) {
return '1'
} else {
return '2'
}
}
}
},
data() {
return {
total: 0,
@ -47,6 +81,9 @@ export default {
pageNum: 1,
pageSize: 10,
},
classType: '',
currentCourse: {},
dialogVisible: false,
base: process.env.VUE_APP_BASE_API,
}
},
@ -71,18 +108,51 @@ export default {
this.$message.warning('下载失败,请联系管理员')
}
},
copy(text) {
const result = copyText(text)
if (result) {
this.dialogVisible = false
this.$message.success('复制成功')
}
},
toLearn(course, toggle) {
return
if (this.classType != 4) {
return
}
if (toggle) {
this.currentCourse = course
this.dialogVisible = true
return
}
let toLearn = false
if ((course.isPay == '1') && (course.remark.indexOf(course.courseId) == -1)) {
toLearn = false
} else {
toLearn = true
}
this.$router.push({
path: 'onLineCourse',
query: {
courseId: course.courseId,
toLearn: toLearn
}
})
}
},
}
</script>
<style>
.courseWrap{
.courseWrap {
height: 100%;
overflow: hidden;
}
.courseItemWrap {
margin-top: 10px;
}
.courseItem {
margin: 0 20px;
height: 150px;
@ -92,11 +162,13 @@ export default {
font-family: PingFang SC;
font-weight: 500;
}
.courseItem > * {
.courseItem>* {
height: 50%;
padding-left: 30px;
padding-right: 30px;
}
.courseItem .courseTime {
line-height: 75px;
font-size: 14px;
@ -104,10 +176,29 @@ export default {
display: flex;
justify-content: space-between;
}
.noCourse {
text-align: center;
font-size: 20px;
}
.freeDialog .el-divider {
margin: -30px 0 10px 0;
}
.freeDialog .el-dialog__title {
font-weight: bold;
}
.copyLearnLink {
font-family: PingFang SC;
text-align: center;
font-weight: 500;
font-size: 16px;
color: #1A1A1A;
line-height: 30px;
}
.courseItem .courseName {
line-height: 75px;
font-size: 18px;
@ -115,9 +206,16 @@ export default {
display: flex;
justify-content: space-between;
}
.onLine {
color: #0066eb;
cursor: pointer
}
.courseItem :first-child {
border-bottom: 1px solid rgba(17, 19, 21, 0.06);
}
.signInLog {
margin-top: 30px;
width: 75px;
@ -129,10 +227,24 @@ export default {
color: #ffffff;
border-radius: 13px;
}
.toLearn {
cursor: pointer;
background: linear-gradient(90deg, #FB8C16, #FEC36E)
}
.toPay {
width: 100px;
cursor: pointer;
background: linear-gradient(90deg, #5EA6FD, #1A81F9);
border: 1px solid #AAD1FE;
}
.sourceWrap {
display: flex;
}
.sourceWrap > * {
.sourceWrap>* {
cursor: pointer;
margin-right: 20px;
font-family: PingFang SC;

@ -0,0 +1,340 @@
<template>
<div class="onLineWrap" v-show="courseCon.courseName">
<div class="courseName">{{ courseCon.courseName }}</div>
<div class="line"></div>
<div class="courseTime">时间{{ yyyDate(courseCon.courseTime) }}</div>
<div class="courseTime">讲师{{ courseCon.instructor }}</div>
<div class="courseTime" v-show="courseCon.title">职称{{ courseCon.title }}</div>
<div class="courseTime">授课内容{{ courseCon.courseContent }}</div>
<div class="onLineBtnCoup">
<div v-if="startLeran" class="payLearn" type="primary" @click="toLearn">开始学习</div>
<div v-if="!startLeran" @click="toPay" class="payLearn" type="primary">付费学习 {{ courseCon.amount }}</div>
<div v-if="!startLeran" @click="toInpWord" class="inpPass" type="text">输入口令学习</div>
</div>
<el-dialog :title="title" :visible.sync="dialogVisible" width="450px" class="onlineDialog" @close="closed">
<el-divider></el-divider>
<el-dialog class="onlineDialog" @close="inClosed" width="30%" :title="'支付'" :visible.sync="innerVisible"
append-to-body>
<el-divider></el-divider>
<div style="text-align: center;margin-top: 30px;">
<qrcode :value="codeUrl" :options="options"></qrcode>
<div style="margin-top: 5px">请使用{{ paymentType == 'A01' ? '支付宝' : '微信' }}扫描二维码</div>
</div>
</el-dialog>
<div v-if="current == 'pass'" class="verification-container">
<input v-for="(code, index) in verificationCodes" :key="index" v-model="verificationCodes[index]"
@input="handleInput(index, $event)" @keydown="handleKeyDown(index, $event)" maxlength="1"
class="verification-input" />
</div>
<div v-else-if="current == 'pay'">
<el-form label-width="80px" class="payLabel">
<el-form-item label="应付金额:" class="payLabel">
<div style="color: rgb(253, 70, 26);font-size: 25px;"> {{ courseCon.amount }}</div>
</el-form-item>
<el-form-item label="支付方式:">
<el-radio size="small" class="paytypebtn" v-model="paymentType" label="A01" border>
<img class="btnpayimg" src="/assets/home/zfb.png" alt="" />支付宝</el-radio>
<el-radio size="small" class="paytypebtn" v-model="paymentType" label="W01" border>
<img class="btnpayimg" src="/assets/home/wx.png" alt="" />微信</el-radio>
</el-form-item>
</el-form>
</div>
<div v-else class="copyLearnLink">
<div>学习链接</div>
<div style="margin: 1px">请使用腾讯会议打开</div>
<div>{{ courseCon.url }}</div>
</div>
<div slot="footer" style="text-align: center">
<el-button type="primary" style="width: 250px;height: 44px;border-radius: 22px;" @click="submit">{{
(current == 'copy') ? '复制链接' : '确定' }}</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { getOnlineCourse, subPass, payForOnlineCourse } from '@/api/train';
import { dateFormat } from '@/util/util';
import copyText from '@/util/cpoyText';
import { mapGetters } from 'vuex'
import VueQrcode from '@xkeshi/vue-qrcode'
import { searchOrderStatus } from '@/api/pay/index.js'
export default {
components: {
qrcode: VueQrcode,
},
data() {
return {
title: '',
courseId: '',
options: { size: 150 },
startLeran: false,
current: '',
courseCon: {},
dialogVisible: false,
innerVisible: false,
orderSearch: null,
verificationCodes: ['', '', '', ''],
paymentType: 'A01',
codeUrl: ''
}
},
created() {
this.courseId = this.$route.query.courseId
this.startLeran = this.$route.query.toLearn === 'true'
getOnlineCourse(this.courseId).then(res => {
this.courseCon = res.data
})
},
computed: {
...mapGetters(['paytype', 'tooltypelist', 'token', 'userinform']),
yyyDate() {
return function (val) {
return dateFormat(new Date(val))
}
}
},
methods: {
closed() {
this.verificationCodes = ['', '', '', '']
},
inClosed() {
clearInterval(this.orderSearch)
this.orderSearch = null
},
toInpWord() {
this.current = 'pass'
this.title = '请输入口令'
this.dialogVisible = true
},
toPay() {
this.current = 'pay'
this.title = '付款'
this.dialogVisible = true
},
toLearn() {
this.current = 'copy'
this.dialogVisible = true
this.title = '复制学习链接'
},
async pay() {
const id = this.userinform.userId
const data = {
"price": this.courseCon.amount,
"payType": this.paymentType,
"userId": id,
// "recordName": this.courseItem.courseName,
// "toolId":this.courseItem.courseId
}
const res = await payForOnlineCourse(data)
if (res) {
console.log(res);
this.codeUrl = res.data.payinfo
this.innerVisible = true
this.orderSearch = setInterval(() => {
searchOrderStatus({ reqsn: res.data.reqsn }).then(res => {
if (res) {
clearInterval(this.orderSearch)
this.orderSearch = null
this.$message.success('支付成功')
}
})
}, 5000);
}
this.innerVisible = true
},
submit() {
if (this.current == 'copy') {
const res = copyText(this.courseCon.url)
if (res) {
this.$message.success("复制成功")
this.dialogVisible = false
}
} else if (this.current == 'pay') {
this.pay()
return
}
const code = this.verificationCodes.toString().replaceAll(",", "")
if (code.length != 4) {
return
}
subPass(this.courseId, code).then(res => {
if (res.code == 200) {
this.startLeran = true
}
this.verificationCodes = ['', '', '', '']
this.dialogVisible = false
})
},
handleInput(index, event) {
const value = event.target.value;
this.verificationCodes[index] = value;
//
if (value && index < this.verificationCodes.length - 1) {
const nextInput = event.target.nextElementSibling;
if (nextInput) {
this.$nextTick(() => {
nextInput.focus()
});
}
}
},
handleKeyDown(index, event) {
//
if (event.key === 'Backspace' && !event.target.value && index > 0) {
const prevInput = event.target.previousElementSibling;
if (prevInput) {
this.$nextTick(() => {
prevInput.focus();
});
}
}
}
}
}
</script>
<style lang="scss">
.paytypebtn {
.el-radio__label {
display: flex;
align-items: center;
}
.el-radio__input {
display: none;
}
}
.payLabel {
.el-form-item__content {
font-weight: 500;
font-size: 19px;
color: grey;
}
}
.verification-container {
display: flex;
justify-content: center;
margin-top: 40px;
}
.verification-input {
width: 54px;
height: 54px;
background: #ECEFF3;
margin: 0 15px;
text-align: center;
font-size: 18px;
border-radius: 5px;
border: none;
}
.verification-input:focus {
outline: none;
border-color: #007bff;
box-shadow: 0 0 5px #007bff;
}
.onlineDialog {
.el-divider {
margin: -30px 0 10px 0;
}
.el-dialog__title {
font-weight: bold !important;
}
}
.btnpayimg {
width: 17px;
height: 17px;
margin-right: 5px;
}
.onLineWrap {
padding: 10px 0 0 0;
font-family: PingFang SC;
.courseName {
margin-left: 40px;
font-weight: bold;
font-size: 18px;
color: #1A1A1A;
}
.line {
width: 1631px;
height: 1px;
background: #999999;
opacity: 0.15;
margin-top: 24px;
}
.courseTime {
margin-top: 15px;
margin-left: 40px;
}
.onLineBtnCoup {
position: absolute;
bottom: 20px;
display: flex;
flex-direction: column;
justify-content: center;
left: 50%;
transform: translate(-50%);
.inpPass {
text-align: center;
height: 16px;
font-family: PingFang SC;
font-weight: 500;
font-size: 16px;
color: #2286FA;
line-height: 33px;
margin-bottom: 70px;
cursor: pointer;
}
.payLearn {
width: 160px;
height: 36px;
background: #2286FA;
border-radius: 18px;
font-family: PingFang SC;
font-weight: 500;
font-size: 16px;
color: #FFFFFF;
line-height: 36px;
text-align: center;
margin-bottom: 15px;
cursor: pointer;
}
.el-button {
margin: 10px;
}
}
}
.copyLearnLink {
font-family: PingFang SC;
text-align: center;
font-weight: 500;
font-size: 16px;
color: #1A1A1A;
line-height: 30px;
}
</style>

@ -19,9 +19,12 @@
margin: 0 35px 0 28px;
align-items: center;
">
<p style="color: #666666">报名时间{{ dateFormat(new Date(item.registrationTime)) }}</p>
<p style="color: #333333">开课日期{{ dateFormat(new Date(item.trainStartTime), 'yyyy-MM-dd') }}</p>
<p style="color: #333333">结课时间{{ dateFormat(new Date(item.trainEndTime), 'yyyy-MM-dd') }}</p>
<p v-show="item.registrationTime" style="color: #666666">报名时间{{ dateFormat(new
Date(item.registrationTime)) }}</p>
<p v-show="item.trainStartTime" style="color: #333333">开课日期{{ dateFormat(new Date(item.trainStartTime),
'yyyy-MM-dd') }}</p>
<p v-show="item.trainEndTime" style="color: #333333">结课时间{{ dateFormat(new Date(item.trainEndTime),
'yyyy-MM-dd') }}</p>
</div>
<div class="downloadAbount" @click="curCourse(item)">
<div class="catCourse" v-if="item.attachment" @click="downLoad(item)">资料下载</div>
@ -43,6 +46,8 @@ import { mapGetters } from 'vuex'
import { getmySignUpList, uploadEndClassReport } from '@/api/train/index.js'
import { dateFormat } from '@/util/util'
import myUpload from '@/components/myUpload/index.vue'
import { valiDateInOneDay } from '../../../util/util'
import downPdf from '../../../util/pdfDownLoad'
export default {
components: {
myUpload, emptyPage
@ -65,17 +70,8 @@ export default {
computed: {
reportShow() {
return function (val) {
const nowTime = new Date().getTime()
const endTime = new Date(val.trainEndTime).getTime()
console.log('endtIME'+new Date(val.trainEndTime));
const sub = (endTime - nowTime) / (1000 * 60 * 60 * 24)
console.log(sub);
if (sub < 0) {
return false
} else if (sub < endDay) {
return true
}
return false
const toggle = valiDateInOneDay(val.trainEndTime)
if (toggle) { return true } return false
}
},
...mapGetters(['userinform']),
@ -85,7 +81,8 @@ export default {
dateFormat,
downLoad(row) {
if (row.attachment) {
window.open(this.base + row.attachment, '_self')
// window.open(this.base + row.attachment, '_self')
downPdf(this.base + row.attachment)
}
},
curCourse(item) {
@ -99,17 +96,23 @@ export default {
}
const res = await uploadEndClassReport(data)
if (res.code == 200) {
getmySignUpList().then((res) => {
console.log('resresresres', res.rows)
this.signlist = res.rows
// this.total = res.total;
})
this.$message.success('上传成功')
}
},
endReportDownload(row) {
if (row.reportAttachment) {
window.open(this.base + row.reportAttachment, '_self')
downPdf(this.base + row.reportAttachment)
// window.open(t, '_self')
}
},
catCourse(param) {
// console.log(param.trainClassId);
this.$router.push({ path: '/console/course', query: { id: param.trainClassId } })
this.$router.push({ path: '/console/course', query: { id: param.trainClassId, classType: param.classType } })
}
},
}

@ -6,14 +6,15 @@
</div> -->
<div style="background: #FFFFFF;border-radius: 4px;">
<div class="ordenum">
<el-form :model="queryParam" :rules="rules" label-position="left" label-width="70px" class="baseinfo" ref="queryForm">
<el-form :model="queryParam" :rules="rules" label-position="left" label-width="70px" class="baseinfo"
ref="queryForm">
<div style="display:flex;flex-wrap:wrap;padding-top: 10px;padding-left: 20px;background: #edecec;">
<el-form-item label="任务名称" prop="projectName" >
<el-input v-model="queryParam.projectName" size="mini" clearable></el-input>
<el-form-item label="任务名称" prop="projectName">
<el-input v-model="queryParam.projectName" size="mini" clearable></el-input>
</el-form-item>
<el-form-item label="任务状态" prop="status" style="margin-left:20px">
<el-input v-model="queryParam.status"></el-input>
<el-select v-model="queryParam.status" placeholder="" size="mini" clearable>
<el-form-item label="任务状态" prop="status" style="margin-left:20px">
<!-- <el-input v-model="queryParam.status"></el-input> -->
<el-select v-model="queryParam.status" placeholder="" size="mini" clearable>
<!-- <el-option label="请选择" value="">请选择</el-option> -->
<el-option label="测试中" value="0">执行中</el-option>
<el-option label="任务完成" value="1">处理完成</el-option>
@ -21,7 +22,7 @@
<el-option label="任务失败" value="3">异常</el-option>
</el-select>
</el-form-item>
<el-button type="primary" icon="el-icon-search" size="small" @click="getList()">搜索</el-button>
<el-button type="primary" icon="el-icon-search" size="small" @click="getList()">搜索</el-button>
<el-button style="background: #F2A51A;" @click="resetQuery">重置</el-button>
</div>
</el-form>
@ -31,333 +32,357 @@
{{ scope.$index + 1 }}
</template>
</el-table-column>
<el-table-column label="任务ID" align="center" key="jobLogId" prop="jobLogId" width="80" />
<el-table-column label="测试工具" align="center" key="toolName" prop="toolName" :show-overflow-tooltip="true" />
<el-table-column label="任务名称" align="center" key="projectName" prop="projectName" :show-overflow-tooltip="true" />
<el-table-column label="创建时间" align="center" key="createTime" prop="createTime" width="180" >
<el-table-column label="任务ID" align="center" key="jobLogId" prop="jobLogId" width="80" />
<el-table-column label="测试工具" align="center" key="toolName" prop="toolName"
:show-overflow-tooltip="true" />
<el-table-column label="任务名称" align="center" key="projectName" prop="projectName"
:show-overflow-tooltip="true" />
<el-table-column label="创建时间" align="center" key="createTime" prop="createTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column label="更新时间" align="center" prop="updateTime" width="180" >
<el-table-column label="更新时间" align="center" prop="updateTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.updateTime) }}</span>
<span>{{ parseTime(scope.row.updateTime) }}</span>
</template>
</el-table-column>
<el-table-column label="状态" align="center" key="status" prop="status">
<template slot-scope="scope">
<el-tooltip :disabled="scope.row.status == 0 || scope.row.status == 1" :content="scope.row.msg" placement="top" >
<el-tag v-if="scope.row.status == 0" type="primary" effect="dark" size="small"
style="width: 68px; padding-left: 12px; padding-right: 12px;;cursor:pointer" >测试中
</el-tag>
<el-tag v-if="scope.row.status == 1 && (scope.row.fileUrl == null || scope.row.fileUrl == '')" type="primary" effect="dark" size="small"
style="width: 68px; padding-left: 9px; padding-right: 12px;;cursor:pointer" >测试中
</el-tag>
<el-tag v-if="scope.row.status == 1 && scope.row.fileUrl != null && scope.row.fileUrl != ''" type="success" effect="dark" size="small"
style="width: 68px; padding-left: 9px; padding-right: 12px;cursor:pointer" >任务完成
</el-tag>
<el-tag v-if="scope.row.status == 2" type="warning" effect="dark" size="small" style="width: 77px; padding-left: 9px; padding-right: 12px;;cursor:pointer" >
任务异常<i class="el-icon-warning"></i>
</el-tag>
<el-tag v-if="scope.row.status == 3" type="danger" effect="dark" size="small"
style="width: 77px; padding-left: 9px; padding-right: 12px;cursor:pointer" >任务失败 <i class="el-icon-warning"></i>
</el-tag>
</el-tooltip>
<el-tooltip :disabled="scope.row.status == 0 || scope.row.status == 1"
:content="scope.row.msg" placement="top">
<el-tag v-if="scope.row.status == 0" type="primary" effect="dark" size="small"
style="width: 68px; padding-left: 12px; padding-right: 12px;;cursor:pointer">测试中
</el-tag>
<el-tag
v-if="scope.row.status == 1 && (scope.row.fileUrl == null || scope.row.fileUrl == '')"
type="primary" effect="dark" size="small"
style="width: 68px; padding-left: 9px; padding-right: 12px;;cursor:pointer">测试中
</el-tag>
<el-tag
v-if="scope.row.status == 1 && scope.row.fileUrl != null && scope.row.fileUrl != ''"
type="success" effect="dark" size="small"
style="width: 68px; padding-left: 9px; padding-right: 12px;cursor:pointer">任务完成
</el-tag>
<el-tag v-if="scope.row.status == 2" type="warning" effect="dark" size="small"
style="width: 77px; padding-left: 9px; padding-right: 12px;;cursor:pointer">
任务异常<i class="el-icon-warning"></i>
</el-tag>
<el-tag v-if="scope.row.status == 3" type="danger" effect="dark" size="small"
style="width: 77px; padding-left: 9px; padding-right: 12px;cursor:pointer">任务失败 <i
class="el-icon-warning"></i>
</el-tag>
</el-tooltip>
</template>
</el-table-column>
<el-table-column align="center" label="操作">
<template slot-scope="scope">
<el-button v-if="scope.row.status == 0" size="mini" type="text" icon="el-icon-help" style="color: #1890ff !important"
@click="viewTime(scope.row)">查看测试进度
</el-button>
<!-- -->
<el-button v-if="scope.row.status == 1 && (scope.row.fileUrl == null || scope.row.fileUrl == '')" size="mini" type="text" icon="el-icon-help"
style="color: #1890ff !important" @click="viewTime(scope.row)" >查看测试进度
</el-button>
<!-- -->
<el-button v-if="scope.row.status == 1 && scope.row.fileUrl != null && scope.row.fileUrl != ''" size="mini" type="text" icon="el-icon-help"
style="color: #1890ff !important" @click="viewResult(scope.row)">查看测试结果
</el-button>
<el-button v-if="scope.row.status == 2" size="mini" type="text" icon="el-icon-help" style="color: #1890ff !important"
@click="resubmit(scope.row)" >重新提交任务
</el-button>
<el-button v-if="scope.row.status == 0" size="mini" type="text" icon="el-icon-help"
style="color: #1890ff !important" @click="viewTime(scope.row)">查看测试进度
</el-button>
<!-- -->
<el-button
v-if="scope.row.status == 1 && (scope.row.fileUrl == null || scope.row.fileUrl == '')"
size="mini" type="text" icon="el-icon-help" style="color: #1890ff !important"
@click="viewTime(scope.row)">查看测试进度
</el-button>
<!-- -->
<el-button
v-if="scope.row.status == 1 && scope.row.fileUrl != null && scope.row.fileUrl != ''"
size="mini" type="text" icon="el-icon-help" style="color: #1890ff !important"
@click="viewResult(scope.row)">查看测试结果
</el-button>
<el-button v-if="scope.row.status == 2" size="mini" type="text" icon="el-icon-help"
style="color: #1890ff !important" @click="resubmit(scope.row)">重新提交任务
</el-button>
</template>
</el-table-column>
</el-table>
<!-- @size-change="handleSizeChange" :current-page="currentPage" -->
<div v-if="total>8" style='width:100%;margin-top:30px;text-align: center;'>
<el-pagination background
@current-change="handleCurrentChange"
:page-size="queryParam.pageSize"
layout="total, prev, pager, next, jumper"
:total="total">
<div v-if="total > 8" style='width:100%;margin-top:30px;text-align: center;'>
<el-pagination background @current-change="handleCurrentChange" :page-size="queryParam.pageSize"
layout="total, prev, pager, next, jumper" :total="total">
</el-pagination>
</div>
</div>
</div>
<el-dialog title="测试结果详情" :visible.sync="resultOpen" width="600px" :close-on-click-modal="false" append-to-body class="tooldialog" @close="confirmResult()">
<el-dialog title="测试结果详情" :visible.sync="resultOpen" width="600px" :close-on-click-modal="false" append-to-body
class="tooldialog" @close="confirmResult()">
<el-divider style="margin-bottom:10px"></el-divider>
<div style="display:flex;margin-left:30px;">
<p style="font-weight:bold;margin-right:20px;color:#333333;">工具名称</p>
<p>{{currentToolName}}</p>
<p>{{ currentToolName }}</p>
</div>
<div style="display:flex;margin-left:30px;">
<p style="font-weight:bold;margin-right:20px;color:#333333;">任务名称</p>
<p>{{currentTaskName}}</p>
<p>{{ currentTaskName }}</p>
</div>
<div v-for="(value, key) in result" :key="key">
<div style="display:flex;margin-left:30px;" v-if="key != 'url' && key != 'userId'" :style="key == 'score' ? '{width:200px;font-size:18px;color:#0969bd;}' : ''">
<p style="font-weight:bold;margin-right:20px;color:#333333;">{{getLabel(key)}}</p>
<p v-html="key == 'testLevel'
? getTestLevelText(value) : key == 'testPlug' || key == 'testMilitary' || key == 'status'
? getBooleanText(value)
: key == 'fileName'
? getDownloadUrl(value)
: key == 'score'
? getScore(value)
: value">
<div style="display:flex;margin-left:30px;" v-if="key != 'url' && key != 'userId'"
:style="key == 'score' ? '{width:200px;font-size:18px;color:#0969bd;}' : ''">
<p style="font-weight:bold;margin-right:20px;color:#333333;">{{ getLabel(key) }}</p>
<p v-html="key == 'testLevel'
? getTestLevelText(value) : key == 'testPlug' || key == 'testMilitary' || key == 'status'
? getBooleanText(value)
: key == 'fileName'
? getDownloadUrl(value)
: key == 'score'
? getScore(value)
: value">
</p>
</div>
</div>
<div style="text-align:center;margin-top:20px" @click="downloadFile(downloadUrl)">
<div style="text-align:center;margin-top:20px" @click="downloadFile(downloadUrl)">
<el-button icon='el-icon-download' style="background: #0066EB;color:#FFFFFF">下载测试结果报告</el-button>
</div>
</el-dialog>
<el-dialog title="测试进度" :visible.sync="timeOpen" :close-on-click-modal="false" width="600px" append-to-body @close="confirmResult(1)" class="tooldialog">
<el-divider style="margin-bottom:10px"></el-divider>
<el-dialog title="测试进度" :visible.sync="timeOpen" :close-on-click-modal="false" width="600px" append-to-body
@close="confirmResult(1)" class="tooldialog">
<el-divider style="margin-bottom:10px"></el-divider>
<div style="display:flex;margin-left:50px;">
<p style="font-weight:bold;margin-right:30px;color:#333333;">工具名称</p>
<p>{{currentToolName}}</p>
<p>{{ currentToolName }}</p>
</div>
<div style="display:flex;margin-left:50px;">
<p style="font-weight:bold;margin-right:30px;color:#333333;">任务名称</p>
<p>{{currentTaskName}}</p>
<p>{{ currentTaskName }}</p>
</div>
<div style="display:flex;margin-left:50px;">
<p style="font-weight:bold;margin-right:30px;color:#333333;">测试进度</p>
<p>已完成{{ remainTime }}%</p>
</div>
<div style="text-align:center;margin-top:20px">
<el-button style="background: #0066EB;color:#FFFFFF;width:100px" @click="confirmResult(1)">确定</el-button>
<el-button style="background: #0066EB;color:#FFFFFF;width:100px"
@click="confirmResult(1)">确定</el-button>
</div>
</el-dialog>
<task-upload ref="taskUpload" @handleSuccess="getList"></task-upload>
</div>
</template>
<script>
import { listMyTasks } from "@/api/my/my";
import { queryProcess, queryResult } from "@/api/task/task";
import TaskUpload from "./TaskUpload";
import {mapGetters} from "vuex";
export default{
components: { TaskUpload },
data(){
return{
loading:false,
//
queryParam: {
taskType: undefined,
projectName: undefined,
status: undefined,
pageNum: 1,
pageSize: 10,
},
rules:{},
tasksdata:[],
total:'',
timeOpen: false,//
resultOpen: false,//
result: {},
downloadUrl: "",//id
currentToolName: "",//
currentTaskName: "",//
remainTime: 0,//
}
import { listMyTasks } from "@/api/my/my";
import { queryProcess, queryResult } from "@/api/task/task";
import TaskUpload from "./TaskUpload";
import { mapGetters } from "vuex";
export default {
components: { TaskUpload },
data() {
return {
loading: false,
//
queryParam: {
taskType: undefined,
projectName: undefined,
status: undefined,
pageNum: 1,
pageSize: 10,
},
rules: {},
tasksdata: [],
total: '',
timeOpen: false,//
resultOpen: false,//
result: {},
downloadUrl: "",//id
currentToolName: "",//
currentTaskName: "",//
remainTime: 0,//
}
},
computed: {
...mapGetters(['token'])
},
mounted() {
if (this.token) {
this.getList();
}
},
methods: {
//
resetQuery() {
this.resetForm("queryForm");
this.getList();
},
computed: {
...mapGetters(['token'])
getList() {
this.loading = true;
listMyTasks(this.queryParam).then((response) => {
this.tasksdata = response.rows;
this.total = response.total;
this.loading = false;
});
},
mounted(){
if(this.token){
this.getList();
}
// //
// handleSizeChange(val) {
// this.queryParam.pageSize=val;
// this.getList();
// },
//
handleCurrentChange(val) {
this.queryParam.pageNum = val;
this.getList();
},
methods:{
//
resetQuery() {
this.resetForm("queryForm");
this.getList();
},
getList(){
this.loading = true;
listMyTasks(this.queryParam).then((response) => {
this.tasksdata = response.rows;
this.total = response.total;
this.loading = false;
});
},
// //
// handleSizeChange(val) {
// this.queryParam.pageSize=val;
// this.getList();
// },
//
handleCurrentChange(val) {
this.queryParam.pageNum=val;
this.getList();
},
//
resubmit(row) {
this.$refs.taskUpload.resubmit(row.taskId, row.toolId, row.toolName);
},
//
viewResult(row) {
this.currentToolName = row.toolName;
this.currentTaskName = row.projectName;
queryResult(row.taskId).then((res) => {
if (res.result) {
this.result = JSON.parse(res.result);
this.resultOpen = true;
this.downloadUrl = this.result["url"];
// this.downloadUrl =res.fileUrl;
}else{
this.$message.warning('暂无结果')
}
if (res.fileUrl) {
this.downloadUrl = res.fileUrl;
}
});
},
//
viewTime(row) {
this.currentToolName = row.toolName;
this.currentTaskName = row.projectName;
queryProcess(row.taskId).then((res) => {
if (res.remainTime) {
//
resubmit(row) {
this.$refs.taskUpload.resubmit(row.taskId, row.toolId, row.toolName);
},
//
viewResult(row) {
this.currentToolName = row.toolName;
this.currentTaskName = row.projectName;
queryResult(row.taskId).then((res) => {
if (res.result) {
this.result = JSON.parse(res.result);
this.resultOpen = true;
this.downloadUrl = this.result["url"];
// this.downloadUrl =res.fileUrl;
} else {
this.$message.warning('暂无结果')
}
if (res.fileUrl) {
this.downloadUrl = res.fileUrl;
}
});
},
//
viewTime(row) {
this.currentToolName = row.toolName;
this.currentTaskName = row.projectName;
queryProcess(row.taskId).then((res) => {
if (res.remainTime) {
this.remainTime = res.remainTime;
}
});
this.timeOpen = true;
},
downloadResult() {
download(this.downloadUrl);
},
//
downloadFile(fileid) {
const loading = this.$loading({
lock: true,
text: '正在下载,请稍后...',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
// downloadHttp(fileid)
// let fileUrl=`https://keyitest.cn/prod-api/common/download/fast?filePath=${fileid}&delete=false`
// window.location.href=fileUrl
downloadFast(fileid,loading);
},
getLabel(key) {
if ("testPlug" == key) return "是否检测第三方插件";
if ("testMilitary" == key) return "是否军用代码";
if ("testLevel" == key) return "检测特征级别";
if ("status" == key) return "是否存在分析结果";
if ("sensitivityThreshold" == key) return "灵敏度阈值";
if ("fileName" == key) return "测试结果";
if ("version" == key) return "版本";
if ("score" == key) return "测试得分";
if ("projectId" == key) return "项目ID";
return key;
},
getBooleanText(value) {
if (value == 0) return "否";
else return "是";
},
getTestLevelText(value) {
if (value == 0) return "否";
else return "是";
},
getDownloadUrl(value) {
// let url = this.result['url'];
// + '&nbsp;&nbsp;<a href="javascript:downloadFast(\''+url+'\')" class="el-button el-button--primary el-button-mini btn-blue"></a>'
return value;
},
getScore(value) {
return (
'<span style="font-weight: bold;font-size: 24px;line-height: 33px;color:#e84c3d;">' +
value +
"</span>"
);
},
//
confirmResult(flag) {
if (flag == 1) {
this.timeOpen = false;
this.getList();
} else
this.resultOpen = false;
},
}
}
});
this.timeOpen = true;
},
downloadResult() {
download(this.downloadUrl);
},
//
downloadFile(fileid) {
const loading = this.$loading({
lock: true,
text: '正在下载,请稍后...',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
// downloadHttp(fileid)
// let fileUrl=`https://keyitest.cn/prod-api/common/download/fast?filePath=${fileid}&delete=false`
// window.location.href=fileUrl
downloadFast(fileid, loading);
},
getLabel(key) {
if ("testPlug" == key) return "是否检测第三方插件";
if ("testMilitary" == key) return "是否军用代码";
if ("testLevel" == key) return "检测特征级别";
if ("status" == key) return "是否存在分析结果";
if ("sensitivityThreshold" == key) return "灵敏度阈值";
if ("fileName" == key) return "测试结果";
if ("version" == key) return "版本";
if ("score" == key) return "测试得分";
if ("projectId" == key) return "项目ID";
return key;
},
getBooleanText(value) {
if (value == 0) return "否";
else return "是";
},
getTestLevelText(value) {
if (value == 0) return "否";
else return "是";
},
getDownloadUrl(value) {
// let url = this.result['url'];
// + '&nbsp;&nbsp;<a href="javascript:downloadFast(\''+url+'\')" class="el-button el-button--primary el-button-mini btn-blue"></a>'
return value;
},
getScore(value) {
return (
'<span style="font-weight: bold;font-size: 24px;line-height: 33px;color:#e84c3d;">' +
value +
"</span>"
);
},
//
confirmResult(flag) {
if (flag == 1) {
this.timeOpen = false;
this.getList();
} else
this.resultOpen = false;
},
}
}
</script>
<style scoped>
.dvied{
width: 4px;
height: 18px;
background: #0066EB;
}
.baseinfo >>> .el-input, .baseinfo>>>.el-select{
width:206px;
height:40px;
border-radius: unset;
}
/* .baseinfo >>> .el-input__inner{
.dvied {
width: 4px;
height: 18px;
background: #0066EB;
}
.baseinfo>>>.el-input,
.baseinfo>>>.el-select {
width: 206px;
height: 40px;
border-radius: unset;
}
/* .baseinfo >>> .el-input__inner{
height:30px;
} */
.baseinfo>>>.el-button{
width:90px;
height:30px;
background: #0066EB;
border-radius: 4px;
margin-left:20px;
color:#FFFFFF;
margin-top:5px;
line-height:9px;
}
.baseinfo >>> .el-form-item {
margin-bottom: 10px;
}
.ordenum>>>.el-table th{
background-color:#F7F7F7;
color:#666666;
text-align:center;
}
.ordenum>>>.el-table td{
text-align:center;
background-color:#FFFFFF;
height:60px;
color:#333333;
}
.ordenum>>>.el-table--border th{
border-right:#F7F7F7
}
.inforbtn>>>.el-button{
width: 90px;
height: 34px;
background: #0066EB;
border-radius: 4px;
color:#FFFFFF
}
.tooldialog>>>.el-divider--horizontal{
margin:-20px 0 10px 0;
}
.tooldialog>>>.el-form-item__label{
color:#333333;
font-weight:bold;
margin-right:20px
}
.tooldialog>>>.el-dialog__title{
font-weight:bold;
color: #0969bd
}
.baseinfo>>>.el-button {
width: 90px;
height: 30px;
background: #0066EB;
border-radius: 4px;
margin-left: 20px;
color: #FFFFFF;
margin-top: 5px;
line-height: 9px;
}
.baseinfo>>>.el-form-item {
margin-bottom: 10px;
}
.ordenum>>>.el-table th {
background-color: #F7F7F7;
color: #666666;
text-align: center;
}
.ordenum>>>.el-table td {
text-align: center;
background-color: #FFFFFF;
height: 60px;
color: #333333;
}
.ordenum>>>.el-table--border th {
border-right: #F7F7F7
}
.inforbtn>>>.el-button {
width: 90px;
height: 34px;
background: #0066EB;
border-radius: 4px;
color: #FFFFFF
}
.tooldialog>>>.el-divider--horizontal {
margin: -20px 0 10px 0;
}
.tooldialog>>>.el-form-item__label {
color: #333333;
font-weight: bold;
margin-right: 20px
}
.tooldialog>>>.el-dialog__title {
font-weight: bold;
color: #0969bd
}
</style>

@ -32,7 +32,7 @@
</router-link> -->
<!-- License只有按月 按钮下载安装+注册码 -->
<el-button v-if="tool.deliver_type == 'License'" style="background: #0165e9"
@click="downLoad(tool.packagePath)">{{ (tool.packagePath.indexOf('http' == -1) ? '下载' : '复制下载链接') }}</el-button>
@click="downLoad(tool.packagePath)">{{ (tool.packagePath.indexOf('http') == -1 ? '下载' : '复制下载链接') }}</el-button>
<el-button v-if="tool.deliver_type == 'License'" style="background: #f2a51a"
@click="zhuceCodeFn(tool.tool_id)">注册码</el-button>
<!-- SaaS按月 按钮在线试用+专属账密 -->
@ -124,6 +124,7 @@ import TaskUpload from './TaskUpload'
import { mapGetters } from 'vuex'
import { dateFormat } from '@/util/util'
import Axios from 'axios'
import copyText from '../../../util/cpoyText'
export default {
components: { TaskUpload },
data() {
@ -167,8 +168,8 @@ export default {
window.open(this.base + url, '_self')
} else {
// window.open(url, '_self')
navigator.clipboard.writeText(url);
this.$message.success('复制成功')
const result = copyText(url)
result && this.$message.success('复制成功')
}
} else {
this.$message.warning('下载失败,请联系管理员')

@ -5,194 +5,342 @@
<div style="font-weight: bold;color: #333333;font-size: 18px;margin-left:10px">我的订单</div>
</div> -->
<div v-if="orderslist.length" style="background: #FFFFFF;border-radius: 4px;">
<div class="ordenum">
<el-form :model="queryParam" :rules="queryParam" label-position="left" label-width="70px" class="baseinfo">
<div class="ordenum">
<el-form :model="queryParam" :rules="queryParam" label-position="left" label-width="70px"
class="baseinfo">
<div style="display:flex;padding-top: 10px;padding-left: 20px;background: #edecec;flex-wrap:wrap;">
<el-form-item label="工具类型" prop="toolType" >
<el-select v-model="queryParam.toolType" placeholder="" size="mini" clearable>
<el-option label="全部" value=""></el-option>
<el-option v-for="(item,key) of tooltypelist" :key='key' :label="item.dictLabel" :value="item.dictValue"></el-option>
<el-form-item label="工具类型" prop="toolType">
<el-select v-model="queryParam.toolType" placeholder="" size="mini" clearable>
<el-option label="全部" value=""></el-option>
<el-option v-for="(item, key) of tooltypelist" :key='key' :label="item.dictLabel"
:value="item.dictValue"></el-option>
</el-select>
</el-form-item>
<el-form-item label="交付方式" prop="deliverType" style="margin-left:20px" >
<el-select v-model="queryParam.deliverType" placeholder="" size="mini" clearable>
<el-option label="全部" value=""></el-option>
<el-option v-for="(item,key) of paytypelist" :key='key' :label="item.dictLabel" :value="item.dictValue"></el-option>
<el-form-item label="交付方式" prop="deliverType" style="margin-left:20px">
<el-select v-model="queryParam.deliverType" placeholder="" size="mini" clearable>
<el-option label="全部" value=""></el-option>
<el-option v-for="(item, key) of paytypelist" :key='key' :label="item.dictLabel"
:value="item.dictValue"></el-option>
</el-select>
</el-form-item>
<el-form-item label="订单时间" prop="dateRange" style="margin-left:20px">
<el-date-picker v-model="dateRange" type="daterange" size="mini" value-format="yyyy-MM-dd" clearable
range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期">
<el-form-item label="订单时间" prop="dateRange" style="margin-left:20px">
<el-date-picker v-model="dateRange" type="daterange" size="mini" value-format="yyyy-MM-dd"
clearable range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期">
</el-date-picker>
</el-form-item>
<el-button type="primary" icon="el-icon-search" size="small" @click="getMyOrder()">搜索</el-button>
<el-button type="primary" icon="el-icon-search" size="small"
@click="getMyOrder()">搜索</el-button>
<el-button style="background: #F2A51A;" @click="resetForm()">重置</el-button>
</div>
</el-form>
<el-table v-loading='loading' :data="orderslist" style="margin-top:30px" >
<el-table v-loading='loading' :data="orderslist" style="margin-top:30px">
<el-table-column label="序号" width="100px" align="center">
<template slot-scope="scope">
{{ scope.$index + 1 }}
</template>
</el-table-column>
<el-table-column label="订单编号" align="center" key="orderNumber" prop="orderNumber" width='230' :show-overflow-tooltip="true"/>
<el-table-column label="商品名称" align="center" key="name" prop="name" width='230' :show-overflow-tooltip="true"/>
<el-table-column label="商品类型" align="center" key="type" prop="type" :show-overflow-tooltip="true">
<el-table-column label="订单编号" align="center" key="orderNumber" prop="orderNumber" width='230'
:show-overflow-tooltip="true" />
<el-table-column label="商品名称" align="center" key="name" prop="name" width='230'
:show-overflow-tooltip="true" />
<el-table-column label="商品类型" align="center" key="type" prop="type" :show-overflow-tooltip="true">
<template slot-scope="scope">
<p>{{findLabelValueByProp(tooltypelist,scope.row.type,'dictValue','dictLabel')}}</p>
<p>{{ findLabelValueByProp(tooltypelist, scope.row.type, 'dictValue', 'dictLabel') }}</p>
<!-- <tool-type :type="scope.row.type"></tool-type> -->
</template>
</el-table-column>
<el-table-column label="交付方式" align="center" key="deliverType" prop="deliverType" :show-overflow-tooltip="true">
<el-table-column label="交付方式" align="center" key="deliverType" prop="deliverType"
:show-overflow-tooltip="true">
<template slot-scope="scope">
<span>{{ scope.row.priceType == 'offLine' ? '线下服务' : scope.row.deliverType }}</span>
</template>
</el-table-column>
<el-table-column label="商品数量" align="center" key="amount" prop="amount" :show-overflow-tooltip="true"/>
<el-table-column label="商品数量" align="center" key="amount" prop="amount"
:show-overflow-tooltip="true" />
<el-table-column label="订单金额" align="center" key="fee" prop="fee" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span>{{scope.row.fee}}</span>
<span>{{ scope.row.priceType == 'offLine' ? '金额面议' : scope.row.fee }}</span>
</template>
</el-table-column>
<el-table-column label="付款方式" align="center" key="payType" prop="payType" :show-overflow-tooltip="true">
<el-table-column label="付款方式" align="center" key="payType" prop="payType"
:show-overflow-tooltip="true">
<template slot-scope="scope">
<!-- <span>{{scope.row.payType=='wx'?'微信支付':'支付宝支付' }}</span> -->
<span v-if="scope.row.payType=='A01'">支付宝支付</span>
<span v-if="scope.row.payType=='W01'">微信支付</span>
<span v-if="scope.row.payType=='W06'">微信小程序支付</span>
<span v-if="scope.row.payType=='WALLET'">零钱支付</span>
<!-- <span>{{scope.row.payType=='wx'?'微信支付':'支付宝支付' }}</span> -->
<span v-if="scope.row.payType == 'A01' && scope.row.priceType != 'offLine'">支付宝支付</span>
<span v-if="scope.row.payType == 'W01' && scope.row.priceType != 'offLine'">微信支付</span>
<span v-if="scope.row.payType == 'W06' && scope.row.priceType != 'offLine'">微信小程序支付</span>
<span v-if="scope.row.payType == 'WALLET' && scope.row.priceType != 'offLine'">零钱支付</span>
<span v-if="scope.row.priceType == 'offLine'">线下支付</span>
</template>
</el-table-column>
<el-table-column label="订单状态" align="center" key="status" prop="status" :show-overflow-tooltip="true">
<el-table-column label="订单状态" align="center" key="status" prop="status"
:show-overflow-tooltip="true">
<template slot-scope="scope">
<!-- <span>{{scope.row.status==0?'未支付':scope.row.status==1?'支付成功':'支付失败' }}</span> -->
<span v-if="scope.row.status==0">未支付</span>
<span v-if="scope.row.status==1">支付成功</span>
<span v-if="scope.row.status==2">已取消</span>
<span v-if="scope.row.status==3">已过期</span>
<!-- <span>{{scope.row.status==0?'未支付':scope.row.status==1?'支付成功':'支付失败' }}</span> -->
<span style="color: #409EFF;cursor: pointer;"
v-if="scope.row.status == 0 && scope.row.priceType != 'offLine'"
@click="toPay(scope.row)">未支付</span>
<span v-if="scope.row.status == 1 && scope.row.priceType != 'offLine'">支付成功</span>
<span v-if="scope.row.status == 2 && scope.row.priceType != 'offLine'">已取消</span>
<span v-if="scope.row.status == 3 && scope.row.priceType != 'offLine'">已过期</span>
<span v-if="scope.row.priceType == 'offLine'">已完成</span>
</template>
</el-table-column>
<el-table-column label="支付时间" align="center" key="payTime" prop="payTime" width='200'>
<template slot-scope="scope">
<span>{{ parseTime(scope.row.payTime) }}</span>
<span>{{ parseTime(scope.row.payTime) }}</span>
</template>
</el-table-column>
</el-table>
<!-- :page-sizes="[10, 20, 30]"sizes, :current-page="currentPage" -->
<div v-if="total>8" style='width:100%;margin-top:30px;text-align: center;'>
<el-pagination background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:page-size="queryParam.pageSize"
layout="total, prev, pager, next, jumper"
:total="total">
<div v-if="total > 8" style='width:100%;margin-top:30px;text-align: center;'>
<el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange"
:page-size="queryParam.pageSize" layout="total, prev, pager, next, jumper" :total="total">
</el-pagination>
</div>
</div>
<el-dialog class="onlineDialog" title="支付订单" :visible.sync="dialogVisible" width="450px"
@close="dialogBeforeClose">
<div style="text-align: center;">
<qrcode :value="codeUrl" :options="options"></qrcode>
<div>{{ `请使用${payMap[currentOrder.payType]}扫码支付` }}</div>
</div>
</el-dialog>
<el-dialog title="钱包支付" :visible.sync="qianbaoShow" width="600px" class="qcode"
:close-on-click-modal="false">
<div style="display: flex">
<div style="width: 100px; line-height: 40px">交易密码:</div>
<el-input v-model="jypassword" type="password" show-password></el-input>
</div>
<div class="joinpurch123">
<el-button @click="walletPay">立即支付</el-button>
</div>
</el-dialog>
<el-dialog title="设置密码" :visible.sync="nopasswordDialog" width="600px" class="qcode"
:close-on-click-modal="false">
<div style="font-weight: 500; font-size: 16px; color: #333333; text-align: center">
您还未设置过交易密码
</div>
<div class="joinpurch123">
<el-button @click="goSetPassword">去设置</el-button>
</div>
</el-dialog>
</div>
<emptyPage imgSrc="/assets/empty/noUsePerson.png" v-else>暂无订单</emptyPage>
</div>
</template>
<script>
import {mapGetters} from "vuex";
import emptyPage from '@/components/emptyPage/index.vue'
import {getMyOrder} from "@/api/my/my";
import {findByvalue, findLabelValueByProp} from "@/util/util";
export default{
components:{emptyPage},
data(){
return{
// orderObj:{
// searchForm:{toolType:'',deliverType:'',dateRange:''},
// tableData:[], total:'',pageNum:1,pageSize:10,
// },
loading: false,
orderslist: [],
//
total: 0,
//
dateRange: [],
//
queryParam: {
pageNum: 1,
pageSize:8,
deliverType: undefined,
toolType: undefined
}
}
import { mapGetters } from "vuex";
import emptyPage from '@/components/emptyPage/index.vue'
import { getMyOrder } from "@/api/my/my";
import { findByvalue, findLabelValueByProp } from "@/util/util";
import VueQrcode from '@xkeshi/vue-qrcode'
import { searchOrderStatus, orderPay, queryAccount, waitOrderToPay } from '@/api/pay/index.js'
const payMap = {
'A01': '支付宝',
'W01': '微信',
'W06': '微信小程序',
'WALLET': '零钱'
}
export default {
components: { emptyPage, qrcode: VueQrcode },
data() {
return {
payMap: payMap,
// orderObj:{
// searchForm:{toolType:'',deliverType:'',dateRange:''},
// tableData:[], total:'',pageNum:1,pageSize:10,
// },
codeUrl: '',
qianbaoShow: false,
nopasswordDialog: false,
options: { size: 150 },
loading: false,
orderslist: [],
//
total: 0,
//
dateRange: [],
searchOrder: null,
dialogVisible: false,
//
queryParam: {
pageNum: 1,
pageSize: 8,
deliverType: undefined,
toolType: undefined
},
currentOrder: {}
}
},
mounted() {
if (this.token) {
this.getMyOrder();
}
},
computed: {
...mapGetters(['paytypelist', 'tooltypelist', 'token', 'userinform'])
},
methods: {
findByvalue, findLabelValueByProp,
//
resetForm() {
this.queryParam.deliverType = ''
this.queryParam.toolType = ''
this.dateRange = []
},
mounted(){
if(this.token){
this.getMyOrder();
}
getMyOrder() {
getMyOrder(this.addDateRange(this.queryParam, this.dateRange)).then(response => {
this.orderslist = response.rows;
this.total = response.total;
})
},
computed: {
...mapGetters(['paytypelist','tooltypelist','token'])
//
handleSizeChange(val) {
this.queryParam.pageSize = val;
this.getMyOrder();
},
methods:{
findByvalue, findLabelValueByProp,
//
resetForm() {
this.queryParam.deliverType=''
this.queryParam.toolType=''
this.dateRange=[]
},
getMyOrder() {
getMyOrder(this.addDateRange(this.queryParam, this.dateRange)).then(response => {
this.orderslist = response.rows;
this.total = response.total;
})
},
//
handleSizeChange(val) {
this.queryParam.pageSize=val;
this.getMyOrder();
},
//
handleCurrentChange(val) {
this.queryParam.pageNum=val;
this.getMyOrder();
}
//
handleCurrentChange(val) {
this.queryParam.pageNum = val;
this.getMyOrder();
},
dialogBeforeClose() {
clearInterval(this.searchOrder)
this.searchOrder = null
},
//
checkAccount() {
queryAccount(this.userinform.userId).then((res) => {
//
if (this.addPriceAll > res.balance) {
//
this.myLQDDisable = true
this.paymentType = 'A01'
this.$message.warning('你的账户零钱不足,请使用其他支付方式')
} else {
//
if (!res.password) {
this.nopasswordDialog = true
} else {
this.qianbaoShow = true
}
}
})
},
// 使
walletPay() {
const row = this.currentOrder
let param = {}
param.toolId = row.toolId
param.amount = row.amount
param.deliverType = row.deliverType
param.price = row.fee
param.paytype = row.payType
param.userId = row.userId
// param.password = encrypt(this.jypassword)
param.priceType = row.priceType
param.recordName = '购买工具:' + row.name
orderPay(param).then((res) => {
if (res.retcode == 'SUCCESS') {
this.qianbaoShow = false
this.paydiaopen = false
this.$message.success('支付成功')
} else {
this.$message.error('支付失败,请联系管理员')
}
})
},
//
async toPay(row) {
this.currentOrder = row
if (row.payType == 'WALLET') {
this.checkAccount()
return
} else if (row.payType == 'W06') {
//
this.$message.warning('该订单无法支付,请使用微信小程序打开')
return
}
console.log(row);
const data = {
orderNumber: row.orderNumber,
payType: row.payType
}
const res = await waitOrderToPay(data)
if (!res) { return }
this.codeUrl = res.payinfo
this.dialogVisible = true
this.searchOrder = setInterval(() => {
searchOrderStatus({ reqsn: res.reqsn }).then(res => {
if (res) {
this.dialogVisible = false
this.$message.success = '支付成功'
this.getMyOrder()
}
})
}, 1000);
}
},
}
}
</script>
<style scoped>
.dvied{
width: 4px;
height: 18px;
background: #0066EB;
}
.baseinfo >>> .el-input, .baseinfo>>>.el-select{
width:206px;
height:40px;
border-radius: unset;
}
/* .baseinfo >>> .el-input__inner{
.dvied {
width: 4px;
height: 18px;
background: #0066EB;
}
.baseinfo>>>.el-input,
.baseinfo>>>.el-select {
width: 206px;
height: 40px;
border-radius: unset;
}
/* .baseinfo >>> .el-input__inner{
height:30px;
} */
.baseinfo>>>.el-button{
width:90px;
height:30px;
background: #0066EB;
border-radius: 4px;
margin-left:20px;
color:#FFFFFF;
margin-top:5px;
line-height:9px;
}
.baseinfo >>> .el-form-item {
margin-bottom: 10px;
}
.ordenum>>>.el-table th{
background-color:#F7F7F7;
color:#666666;
text-align:center;
}
.ordenum>>>.el-table td{
text-align:center;
background-color:#FFFFFF;
color:#333333;
height:60px;
}
.ordenum>>>.el-table--border th{
border-right:#F7F7F7
}
.baseinfo>>>.el-button {
width: 90px;
height: 30px;
background: #0066EB;
border-radius: 4px;
margin-left: 20px;
color: #FFFFFF;
margin-top: 5px;
line-height: 9px;
}
.baseinfo>>>.el-form-item {
margin-bottom: 10px;
}
/*
.onlineDialog .el-dialog__title {
font-weight: bold !important;
} */
.ordenum>>>.el-table th {
background-color: #F7F7F7;
color: #666666;
text-align: center;
}
.ordenum>>>.el-table td {
text-align: center;
background-color: #FFFFFF;
color: #333333;
height: 60px;
}
.ordenum>>>.el-table--border th {
border-right: #F7F7F7
}
</style>

@ -94,7 +94,7 @@
<div style="display: flex; align-items: center">
<div class="dvied"></div>
<div style="font-weight: bold; color: #333333; font-size: 19px; margin-left: 10px">
宝余额
测宝余额
</div>
</div>
<div style="display: flex; align-items: center; font-size: 15px; cursor: pointer"

@ -1,47 +1,48 @@
import Vue from 'vue'
import Router from 'vue-router'
import store from "@/store";
import store from '@/store'
// import { Message,MessageBox } from 'element-ui'
//自定义组件
import login from "@/page/logpage/log/login.vue"
import runEnv from '../util/runEnv';
import login from '@/page/logpage/log/login.vue'
import runEnv from '../util/runEnv'
// import index from "@/page/homepage/index.vue"
const community = () => import("@/page/community/index.vue")
const index = () => import("@/page/homepage/index.vue")
const mobileTip = ()=>import("@/page/common/mobileTip.vue")
const home = () => import("@/page/homepage/home/home.vue")
const toolmarker = () => import("@/page/homepage/tool/toolmarker.vue")
const tooldetails = () => import("@/page/homepage/tool/tooldetails.vue")
const crowd = () => import("@/page/homepage/crowdsourcing/crowd.vue")
const crowddetails = () => import("@/page/homepage/crowdsourcing/crowddetails.vue")
const userhome = () => import("@/page/homepage/crowdsourcing/userhome.vue")
const publishtasks = () => import("@/page/homepage/crowdsourcing/publishtasks.vue")
const train = () => import("@/page/homepage/traininstitute/train.vue")
const teacherSign = () => import("@/page/homepage/traininstitute/teacherSign.vue")
const teacherDetail = () => import("@/page/homepage/traininstitute/teacherDetail.vue")
const ability = () => import("@/page/homepage/personability/ability.vue")
const abilityUser = () => import("@/page/homepage/personability/abilityUser.vue")
const abilityUserD = () => import("@/page/homepage/personability/abilityUserDetail.vue")
const abilityMore = () => import("@/page/homepage/personability/abilityMore.vue")
const abilityMoreDetail = () => import("@/page/homepage/personability/abilityMoreDetail.vue")
const abilityApply = () => import("@/page/homepage/personability/abilityApply.vue")
const aboutwo = () => import("@/page/homepage/aboutus/aboutwo.vue")
const personal = () => import("@/page/personalpage/index.vue")
const personalcenter = () => import("@/page/personalpage/home/personalcenter.vue")
const resume = () => import("@/page/personalpage/home/resume.vue")
const stationmessage = () => import("@/page/personalpage/home/stationmessage.vue")
const myorder = () => import("@/page/personalpage/testtool/myorder.vue")
const mytask = () => import("@/page/personalpage/testmanagement/mytask.vue")
const mytool = () => import("@/page/personalpage/testmanagement/mytool.vue")
const myparticipate = () => import("@/page/personalpage/testcrowd/myparticipate.vue")
const myrelease = () => import("@/page/personalpage/testcrowd/myrelease.vue")
const edittasks = () => import("@/page/personalpage/testcrowd/edittasks.vue")
const testKit = () => import("@/page/personalpage/testtreasure/testKit.vue")
const demand = () => import("@/page/personalpage/demand/index.vue")
const community = () => import('@/page/community/index.vue')
const index = () => import('@/page/homepage/index.vue')
const mobileTip = () => import('@/page/common/mobileTip.vue')
const home = () => import('@/page/homepage/home/home.vue')
const toolmarker = () => import('@/page/homepage/tool/toolmarker.vue')
const tooldetails = () => import('@/page/homepage/tool/tooldetails.vue')
const crowd = () => import('@/page/homepage/crowdsourcing/crowd.vue')
const crowddetails = () => import('@/page/homepage/crowdsourcing/crowddetails.vue')
const userhome = () => import('@/page/homepage/crowdsourcing/userhome.vue')
const publishtasks = () => import('@/page/homepage/crowdsourcing/publishtasks.vue')
const train = () => import('@/page/homepage/traininstitute/train.vue')
const teacherSign = () => import('@/page/homepage/traininstitute/teacherSign.vue')
const teacherDetail = () => import('@/page/homepage/traininstitute/teacherDetail.vue')
const ability = () => import('@/page/homepage/personability/ability.vue')
const abilityUser = () => import('@/page/homepage/personability/abilityUser.vue')
const abilityUserD = () => import('@/page/homepage/personability/abilityUserDetail.vue')
const abilityMore = () => import('@/page/homepage/personability/abilityMore.vue')
const abilityMoreDetail = () => import('@/page/homepage/personability/abilityMoreDetail.vue')
const abilityApply = () => import('@/page/homepage/personability/abilityApply.vue')
const aboutwo = () => import('@/page/homepage/aboutus/aboutwo.vue')
const personal = () => import('@/page/personalpage/index.vue')
const personalcenter = () => import('@/page/personalpage/home/personalcenter.vue')
const resume = () => import('@/page/personalpage/home/resume.vue')
const stationmessage = () => import('@/page/personalpage/home/stationmessage.vue')
const myorder = () => import('@/page/personalpage/testtool/myorder.vue')
const mytask = () => import('@/page/personalpage/testmanagement/mytask.vue')
const mytool = () => import('@/page/personalpage/testmanagement/mytool.vue')
const myparticipate = () => import('@/page/personalpage/testcrowd/myparticipate.vue')
const myrelease = () => import('@/page/personalpage/testcrowd/myrelease.vue')
const edittasks = () => import('@/page/personalpage/testcrowd/edittasks.vue')
const testKit = () => import('@/page/personalpage/testtreasure/testKit.vue')
const demand = () => import('@/page/personalpage/demand/index.vue')
const myreview = () => import('@/page/personalpage/myreview/index.vue')
const myBm = () => import('@/page/personalpage/myBm/index.vue')
const course = () => import('@/page/personalpage/course/index.vue')
const currentcrowd = () => import("@/page/personalpage/testcrowd/currentcrowd.vue")
const onLineCourse = () => import('@/page/personalpage/course/onLineCourse.vue')
const currentcrowd = () => import('@/page/personalpage/testcrowd/currentcrowd.vue')
const jobM = () => import('@/page/personalpage/jobm/job.vue')
const addJob = () => import('@/page/personalpage/jobm/addjob.vue')
const jobUser = () => import('@/page/personalpage/jobm/jobuser.vue')
@ -54,25 +55,30 @@ const router = new Router({
// linkActiveClass:'is-active',
routes: [
{
path: '/community', component: community, name: 'community' ,
path: '/community',
component: community,
name: 'community'
},
{
path:'/mobileTip',component:mobileTip,name:'mobileTip'
path: '/mobileTip',
component: mobileTip,
name: 'mobileTip'
},
//首页
{
path: '', component: index,
path: '',
component: index,
redirect: '/',
children: [
{ path: '/', component: home, name: 'home', },
{ path: 'login', component: login, name: 'login', },
{ path: '/', component: home, name: 'home' },
{ path: 'login', component: login, name: 'login' },
{ path: 'market', component: toolmarker, name: 'market' },
{ path: 'market/tooldetails', component: tooldetails },
{ path: 'crowdsourcing', component: crowd, name: 'crowd', },
{ path: 'crowdsourcing/crowddetails', component: crowddetails, },
{ path: 'crowdsourcing/userhome', component: userhome, },
{ path: 'crowdsourcing/publishtasks', component: publishtasks, },
{ path: 'crowdsourcing', component: crowd, name: 'crowd' },
{ path: 'crowdsourcing/crowddetails', component: crowddetails },
{ path: 'crowdsourcing/userhome', component: userhome },
{ path: 'crowdsourcing/publishtasks', component: publishtasks },
{ path: 'college', component: train },
{ path: 'college/teacherSign', component: teacherSign },
{ path: 'college/teacherDetail', component: teacherDetail },
@ -82,7 +88,7 @@ const router = new Router({
{ path: 'ability/more', component: abilityMore },
{ path: 'ability/more/detail', component: abilityMoreDetail },
{ path: 'ability/apply', component: abilityApply },
{ path: 'about', component: aboutwo },
{ path: 'about', component: aboutwo }
]
},
// 登录相关
@ -100,7 +106,8 @@ const router = new Router({
//个人中心
{
path: '/console', component: personal,
path: '/console',
component: personal,
redirect: '/console/myparticipate',
children: [
{ path: 'profile', component: personalcenter, meta: { title: '个人中心', isAuth: true, type: 1 } },
@ -114,30 +121,27 @@ const router = new Router({
{ path: 'myrelease', component: myrelease, meta: { title: '我发布的', isAuth: true, type: 4 } },
{ path: 'edittasks', component: edittasks, meta: { title: '重新发布', isAuth: true, type: 4 } },
{ path: 'edittasksFB', component: edittasks, meta: { title: '发布任务', isAuth: true, type: 4 } },
{ path: 'account', component: testKit, meta: { title: '我的测宝', isAuth: true, type: 5 } },
{ path: 'account', component: testKit, meta: { title: '我的测宝', isAuth: true, type: 5 } },
{ path: 'demand', component: demand, meta: { title: '我要用人', isAuth: true, type: 6 } },
{ path: 'myreview', component: myreview, meta: { title: '我的评价', isAuth: true, type: 5 } },
{ path: 'myBm', component: myBm, meta: { title: '我的培训班', isAuth: true, type: 5 } },
{ path: 'course', component: course, meta: { title: '我的课程', isAuth: true, type: 5 } },
{ path: 'onLineCourse', component: onLineCourse, meta: { title: '线上课程', isAuth: true, type: 5 } },
{ path: 'addJob', component: addJob, meta: { title: '招聘管理', isAuth: true, type: 5 } },
{ path: 'jobUser', component: jobUser, meta: { title: '招聘管理', isAuth: true, type: 5 } },
{ path: 'jobuserDetail', component: jobuserDetail, meta: { title: '招聘管理', isAuth: true, type: 5 } },
{ path: 'jobM', component: jobM, meta: { title: '招聘管理', isAuth: true, type: 5 } },
{ path: 'jobM', component: jobM, meta: { title: '招聘管理', isAuth: true, type: 5 } }
]
},
],
}
]
})
// 全局路由守卫;
router.beforeEach((to, from, next) => {
// 百度统计
const tjarr = ['/market', '/crowdsourcing', '/ability', '/college', '/about']
if (_hmt) {
if (tjarr.some(it => it == to.path)) {
_hmt.push(['_trackPageview', '/' + to.fullPath]);
_hmt.push(['_trackPageview', '/' + to.fullPath])
}
}
@ -150,16 +154,16 @@ router.beforeEach((to, from, next) => {
}
}
if(to.path == '/') {
if(runEnv()){
if (to.path == '/') {
if (runEnv()) {
next('/mobileTip')
}else{
} else {
next()
}
}
// console.log(store.getters.companyStatus);
let token = store.getters.token;
let token = store.getters.token
// if(token){
// store.dispatch("SET_KEYSAASDICT")
// }
@ -170,13 +174,12 @@ router.beforeEach((to, from, next) => {
// const meta = to.meta || {}
// store.dispatch("SET_KEYSAASDICT")
// let currentdata=Date.parse(new Date());
// let currentdata=Date.parse(new Date());
// let logindate=store.getters.logindate;
// let timedifference=currentdata-(parseInt(logindate)+604800000);
// // console.log('当前时间',currentdata,'登录时间',logindate,'时间差',timedifference)
// // console.log('过期时间',timedifference)
// if (timedifference>0) {
// if (timedifference>0) {
// MessageBox.confirm('登录状态已过期,请重新登录', '系统提示', {
// confirmButtonText: '重新登录',
// showCancelButton:false,
@ -198,8 +201,8 @@ router.beforeEach((to, from, next) => {
// // next({ path: `/login?type=log` })
// // } else {
// // next()
// // }
// } else {
// // }
// } else {
next()
// }
})
@ -209,4 +212,4 @@ const originalPush = Router.prototype.push
Router.prototype.push = function push(location) {
return originalPush.call(this, location).catch(err => err)
}
export default router;
export default router

@ -1,61 +1,61 @@
import { getStore, removeStore, setStore } from '@/util/store'
import { listData ,getDicts} from '@/api/system/dict/data'
import { listData, getDicts } from '@/api/system/dict/data'
const dict = {
state: {
paytypelist: getStore({ name: 'paytypelist' }) || [], //支付方式
tooltypelist: getStore({ name: 'tooltypelist' }) || [], //工具类型
testtypelist: getStore({ name: 'testtypelist' }) || [], //测试类型
feescopelist: getStore({ name: 'feescopelist' }) || [], //金额范围
feescopelist: getStore({ name: 'feescopelist' }) || [] //金额范围
},
actions: {
SET_KEYSAASDICT({commit}) {
getDicts('sys_pay_type').then(res=>{
SET_KEYSAASDICT({ commit }) {
getDicts('sys_pay_type').then(res => {
console.log(res)
// console.log('支付方式:',res)
commit("SET_PAYTYPE", res.data);
commit('SET_PAYTYPE', res.data)
})
getDicts('sys_tool_type').then(res=>{
getDicts('sys_tool_type').then(res => {
// console.log('工具类型',res)
commit("SET_TOOLTYPE", res.data);
commit('SET_TOOLTYPE', res.data)
})
getDicts('sys_test_type').then(res=>{
commit("SET_TESTTYPE", res.data);
getDicts('sys_test_type').then(res => {
commit('SET_TESTTYPE', res.data)
})
getDicts('sys_fee_scope').then(res=>{
commit("SET_FEESCOPE", res.data);
getDicts('sys_fee_scope').then(res => {
commit('SET_FEESCOPE', res.data)
})
},
}
},
mutations:{
mutations: {
SET_PAYTYPE: (state, paytypelist) => {
state.paytypelist = paytypelist
setStore({
name: 'paytypelist',
content: state.paytypelist,
content: state.paytypelist
})
},
SET_TOOLTYPE: (state, tooltypelist) => {
state.tooltypelist = tooltypelist
setStore({
name: 'tooltypelist',
content: state.tooltypelist,
content: state.tooltypelist
})
},
SET_TESTTYPE: (state, testtypelist) => {
state.testtypelist = testtypelist
setStore({
name: 'testtypelist',
content: state.testtypelist,
content: state.testtypelist
})
},
SET_FEESCOPE: (state, feescopelist) => {
state.feescopelist = feescopelist
setStore({
name: 'feescopelist',
content: state.feescopelist,
content: state.feescopelist
})
},
}
}
}

@ -1 +1,8 @@
@import './variable.scss'
@import './reset.scss';
@import './variable.scss';
.contactMissZhang {
.el-notification__content {
color: #f56c6c;
}
}

@ -1 +1,2 @@
$bg-color: #0066eb
$bg-color: #0066eb;
$font-size:500;

@ -0,0 +1,15 @@
function downPdf(val) {
fetch(val).then(respose => {
return respose.blob()
}).then(blob => {
console.log(val);
const url = URL.createObjectURL(blob)
const a = document.createElement("a")
const name = val.substr(val.lastIndexOf('/') + 1, val.length)
a.href = url
a.download = name
a.click()
})
}
export default downPdf

@ -36,9 +36,7 @@ function position() {
* @param {Function} callback
*/
export function scrollTo(to, duration, callback) {
console.log('comming scroll');
const start = position()
console.log(start);
const change = to - start
const increment = 20
let currentTime = 0

@ -4,173 +4,190 @@ import store from "@/store";
import { downzai } from "@/api/system/config";
const baseURL = '/prod-api'
//时间格式转换
export function dateFormat(date, format) {
if(!format) {format = 'yyyy-MM-dd hh:mm:ss';}
if (date !== 'Invalid Date') {
var o = {
'M+': date.getMonth() + 1, // month
'd+': date.getDate(), // day
'h+': date.getHours(), // hour
'm+': date.getMinutes(), // minute
's+': date.getSeconds(), // second
'q+': Math.floor((date.getMonth() + 3) / 3), // quarter
'S': date.getMilliseconds() // millisecond
}
if (/(y+)/.test(format)) {
format = format.replace(RegExp.$1,
(date.getFullYear() + '').substr(4 - RegExp.$1.length))
}
for (var k in o) {
if (new RegExp('(' + k + ')').test(format)) {
format = format.replace(RegExp.$1,
RegExp.$1.length === 1 ? o[k]
: ('00' + o[k]).substr(('' + o[k]).length))
}
}
return format
}
return ''
const baseURL = '/prod-api'
//时间格式转换
export function dateFormat(date, format) {
if (!format) { format = 'yyyy-MM-dd hh:mm:ss'; }
if (date !== 'Invalid Date') {
var o = {
'M+': date.getMonth() + 1, // month
'd+': date.getDate(), // day
'h+': date.getHours(), // hour
'm+': date.getMinutes(), // minute
's+': date.getSeconds(), // second
'q+': Math.floor((date.getMonth() + 3) / 3), // quarter
'S': date.getMilliseconds() // millisecond
}
if (/(y+)/.test(format)) {
format = format.replace(RegExp.$1,
(date.getFullYear() + '').substr(4 - RegExp.$1.length))
}
for (var k in o) {
if (new RegExp('(' + k + ')').test(format)) {
format = format.replace(RegExp.$1,
RegExp.$1.length === 1 ? o[k]
: ('00' + o[k]).substr(('' + o[k]).length))
}
}
return format
}
return ''
}
export function valiDateInOneDay(endTime) {
const tTime = dateFormat(new Date(endTime))
const tempTime = tTime.split(' ')[0] + ' ' + '00:00:00'
const nTime = new Date()
const sub = Math.abs(nTime.getTime() - (new Date(tempTime)).getTime())
const oneDay = 24 * 60 * 60 * 1000
const twoDay = 24 * 60 * 60 * 1000
console.log(nTime.getTime() - (new Date(tempTime)).getTime());
if ((nTime.getTime() - (new Date(tempTime)).getTime()) > oneDay) {
return false
}
if (sub < twoDay) {
return true
}
return false
}
/**
* 判断是否为空
*/
export function validatenull(val) {
if (typeof val === 'boolean') {
return false
}
if (typeof val === 'number') {
return false
}
if (val instanceof Array) {
if (val.length === 0) return true
} else if (val instanceof Object) {
if (JSON.stringify(val) === '{}') return true
} else {
if (val === 'null' || val == null || val === 'undefined' || val === undefined || val === '') return true
return false
}
export function validatenull(val) {
if (typeof val === 'boolean') {
return false
}
// 转换字符串,undefined,null等转化为""
export function praseStrEmpty(str) {
if (!str || str == "undefined" || str == "null") {
return "";
}
return str;
if (typeof val === 'number') {
return false
}
/**
* 根据字典的数值显示对应的汉字
*/
export const findLabelValueByProp = (dic, value, propl,label) => {
if (!value) return ""
const valueArr = (value+'').split(',')
propl = propl ? propl : 'value';
label = label ? label : 'label';
let resultArr = []
if (validatenull(dic)) return value
valueArr.forEach((it,i) => {
const index = dic.findIndex(item=>item[propl] == valueArr[i])
if (index != -1) {
resultArr.push(dic[index][label])
}
})
return resultArr.join(',')
// console.log(resultArr.join(','));
// let idx = dic.findIndex(item=>item[propl] == value);
// if (idx > -1) { return dic[idx][label] }
// return value
if (val instanceof Array) {
if (val.length === 0) return true
} else if (val instanceof Object) {
if (JSON.stringify(val) === '{}') return true
} else {
if (val === 'null' || val == null || val === 'undefined' || val === undefined || val === '') return true
return false
}
return false
}
// 转换字符串,undefined,null等转化为""
export function praseStrEmpty(str) {
if (!str || str == "undefined" || str == "null") {
return "";
}
return str;
}
/**
* 根据字典的数值显示对应的汉字
*/
export const findLabelValueByProp = (dic, value, propl, label) => {
if (!value) return ""
const valueArr = (value + '').split(',')
propl = propl ? propl : 'value';
label = label ? label : 'label';
let resultArr = []
if (validatenull(dic)) return value
valueArr.forEach((it, i) => {
const index = dic.findIndex(item => item[propl] == valueArr[i])
if (index != -1) {
resultArr.push(dic[index][label])
}
})
return resultArr.join(',')
// console.log(resultArr.join(','));
// let idx = dic.findIndex(item=>item[propl] == value);
// if (idx > -1) { return dic[idx][label] }
// return value
}
/**
* 根据字典的value显示label
*/
export const findByvalue = (dic, value) => {
// console.log('findByvalue',dic, value)
let result = ''
if (validatenull(dic)) return value
if (typeof (value) === 'string' || typeof (value) === 'number' || typeof (value) === 'boolean') {
let index = 0
index = findArray(dic, value)
export const findByvalue = (dic, value) => {
// console.log('findByvalue',dic, value)
let result = ''
if (validatenull(dic)) return value
if (typeof (value) === 'string' || typeof (value) === 'number' || typeof (value) === 'boolean') {
let index = 0
index = findArray(dic, value)
if (index !== -1) {
result = dic[index].label
} else {
result = value
}
} else if (value instanceof Array) {
result = []
let index = 0
value.forEach(ele => {
index = findArray(dic, ele)
if (index !== -1) {
result = dic[index].label
result.push(dic[index].label)
} else {
result = value
result.push(value)
}
} else if (value instanceof Array) {
result = []
let index = 0
value.forEach(ele => {
index = findArray(dic, ele)
if (index !== -1) {
result.push(dic[index].label)
} else {
result.push(value)
}
})
result = result.toString()
}
// console.log('result',result)
return result
})
result = result.toString()
}
// console.log('result',result)
return result
}
/**
* 根据字典的value查找对应的index
*/
export const findArray = (dic, value) => {
for (let i = 0; i < dic.length; i++) {
if (dic[i].value === value) {
return i
}
export const findArray = (dic, value) => {
for (let i = 0; i < dic.length; i++) {
if (dic[i].value === value) {
return i
}
return -1
};
}
return -1
};
// 日期格式化
export function parseTime(time, pattern) {
if (arguments.length === 0 || !time) {
return null
}
const format = pattern || '{y}-{m}-{d} {h}:{i}:{s}'
let date
if (typeof time === 'object') {
date = time
} else {
if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) {
time = parseInt(time)
} else if (typeof time === 'string') {
time = time.replace(new RegExp(/-/gm), '/');
}
if ((typeof time === 'number') && (time.toString().length === 10)) {
time = time * 1000
}
date = new Date(time)
}
const formatObj = {
y: date.getFullYear(),
m: date.getMonth() + 1,
d: date.getDate(),
h: date.getHours(),
i: date.getMinutes(),
s: date.getSeconds(),
a: date.getDay()
}
const time_str = format.replace(/{(y|m|d|h|i|s|a)+}/g, (result, key) => {
let value = formatObj[key]
// Note: getDay() returns 0 on Sunday
if (key === 'a') { return ['日', '一', '二', '三', '四', '五', '六'][value] }
if (result.length > 0 && value < 10) {
value = '0' + value
}
return value || 0
})
return time_str
if (arguments.length === 0 || !time) {
return null
}
const format = pattern || '{y}-{m}-{d} {h}:{i}:{s}'
let date
if (typeof time === 'object') {
date = time
} else {
if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) {
time = parseInt(time)
} else if (typeof time === 'string') {
time = time.replace(new RegExp(/-/gm), '/');
}
if ((typeof time === 'number') && (time.toString().length === 10)) {
time = time * 1000
}
date = new Date(time)
}
const formatObj = {
y: date.getFullYear(),
m: date.getMonth() + 1,
d: date.getDate(),
h: date.getHours(),
i: date.getMinutes(),
s: date.getSeconds(),
a: date.getDay()
}
const time_str = format.replace(/{(y|m|d|h|i|s|a)+}/g, (result, key) => {
let value = formatObj[key]
// Note: getDay() returns 0 on Sunday
if (key === 'a') { return ['日', '一', '二', '三', '四', '五', '六'][value] }
if (result.length > 0 && value < 10) {
value = '0' + value
}
return value || 0
})
return time_str
}
const digitsRE = /(\d{3})(?=\d)/g
export function currency (value, currency, decimals) {
export function currency(value, currency, decimals) {
value = parseFloat(value)
if (!isFinite(value) || (!value && value !== 0)) return ''
currency = currency != null ? currency : '$'
@ -191,102 +208,102 @@ export function currency (value, currency, decimals) {
_int.slice(i).replace(digitsRE, '$1,') +
_float
}
// 表单重置
// 表单重置
export function resetForm(refName) {
if (this.$refs[refName]) {
this.$refs[refName].resetFields();
}
if (this.$refs[refName]) {
this.$refs[refName].resetFields();
}
}
// 添加日期范围
export function addDateRange(params, dateRange, propName) {
// console.log(params, dateRange, propName)
var search = params;
search.params = {};
if (null != dateRange && '' != dateRange) {
if (typeof (propName) === "undefined") {
search.params["beginTime"] = dateRange[0];
search.params["endTime"] = dateRange[1];
} else {
search.params["begin" + propName] = dateRange[0];
search.params["end" + propName] = dateRange[1];
}
}
return search;
var search = params;
search.params = {};
if (null != dateRange && '' != dateRange) {
if (typeof (propName) === "undefined") {
search.params["beginTime"] = dateRange[0];
search.params["endTime"] = dateRange[1];
} else {
search.params["begin" + propName] = dateRange[0];
search.params["end" + propName] = dateRange[1];
}
}
return search;
}
// 回显数据字典
export function selectDictLabel(datas, value) {
var actions = [];
Object.keys(datas).some((key) => {
if (datas[key].dictValue == ('' + value)) {
actions.push(datas[key].dictLabel);
return true;
}
})
return actions.join('');
var actions = [];
Object.keys(datas).some((key) => {
if (datas[key].dictValue == ('' + value)) {
actions.push(datas[key].dictLabel);
return true;
}
})
return actions.join('');
}
// 回显数据字典(字符串数组)
export function selectDictLabels(datas, value, separator) {
var actions = [];
var currentSeparator = undefined === separator ? "," : separator;
var temp = value.split(currentSeparator);
Object.keys(value.split(currentSeparator)).some((val) => {
Object.keys(datas).some((key) => {
if (datas[key].dictValue == ('' + temp[val])) {
actions.push(datas[key].dictLabel + currentSeparator);
}
})
})
return actions.join('').substring(0, actions.join('').length - 1);
var actions = [];
var currentSeparator = undefined === separator ? "," : separator;
var temp = value.split(currentSeparator);
Object.keys(value.split(currentSeparator)).some((val) => {
Object.keys(datas).some((key) => {
if (datas[key].dictValue == ('' + temp[val])) {
actions.push(datas[key].dictLabel + currentSeparator);
}
})
})
return actions.join('').substring(0, actions.join('').length - 1);
}
// 都先去掉 baseURL(/prod-api) 打包部署的时候需要加上
// 通用下载方法
export function download(fileName) {
window.location.href =baseURL + "/common/download?fileName=" + encodeURI(fileName) + "&delete=" + true;
window.location.href = baseURL + "/common/download?fileName=" + encodeURI(fileName) + "&delete=" + true;
}
// 通用下载方法
export function downloadHttp(filePath) {
window.location.href =baseURL + "/common/download/http?filePath=" + encodeURI(filePath) + "&delete=" + false;
window.location.href = baseURL + "/common/download/http?filePath=" + encodeURI(filePath) + "&delete=" + false;
}
// 通用下载方法 http://test.console.lovecode.cc/prod-api
export function downloadFast(filePath, loading) {
// window.location.href = baseURL + "/common/download/fast?filePath=" + encodeURI(filePath) + "&delete=" + false;
var url = baseURL + "/common/download/fast?filePath=" + encodeURI(filePath) + "&delete=" + false;
axios({
method: 'get',
url: url,
responseType: 'blob',
headers: { 'Authorization': 'Bearer ' + store.getters.token }
}).then(res => {
try {
var url = baseURL + "/common/download/fast?filePath=" + encodeURI(filePath) + "&delete=" + false;
axios({
method: 'get',
url: url,
responseType: 'blob',
headers: { 'Authorization': 'Bearer ' + store.getters.token }
}).then(res => {
try {
// console.log('res---',res,)
const aLink = document.createElement('a')
var blob = new Blob([res.data], {type: 'application/octet-stream'})
// //从response的headers中获取filename, 后端response.setHeader("Content-disposition", "attachment; filename=xxxx.docx") 设置的文件名;
const aLink = document.createElement('a')
var blob = new Blob([res.data], { type: 'application/octet-stream' })
// //从response的headers中获取filename, 后端response.setHeader("Content-disposition", "attachment; filename=xxxx.docx") 设置的文件名;
var patt = new RegExp('filename=([^;]+\\.[^\\.;]+);*')
// console.log('aLink---',aLink,blob,patt,)
// return;
var contentDisposition = decodeURI(res.headers['content-disposition'])
var result = patt.exec(contentDisposition)
var fileName = result[1]
fileName = fileName.replace(/\"/g, '')
aLink.href = URL.createObjectURL(blob)
aLink.setAttribute('download', fileName) // 设置下载文件名称
document.body.appendChild(aLink)
aLink.click()
document.body.removeChild(aLink);
loading.close();
} catch (e) {
alert("文件异常,请联系管理员");
loading.close();
}
})
}
// return;
var contentDisposition = decodeURI(res.headers['content-disposition'])
var result = patt.exec(contentDisposition)
var fileName = result[1]
fileName = fileName.replace(/\"/g, '')
aLink.href = URL.createObjectURL(blob)
aLink.setAttribute('download', fileName) // 设置下载文件名称
document.body.appendChild(aLink)
aLink.click()
document.body.removeChild(aLink);
loading.close();
} catch (e) {
alert("文件异常,请联系管理员");
loading.close();
}
})
}
/**
* 构造树型结构数据
* @param {*} data 数据源
@ -295,45 +312,45 @@ export function downloadFast(filePath, loading) {
* @param {*} children 孩子节点字段 默认 'children'
*/
export function handleTree(data, id, parentId, children) {
let config = {
id: id || 'id',
parentId: parentId || 'parentId',
childrenList: children || 'children'
};
let config = {
id: id || 'id',
parentId: parentId || 'parentId',
childrenList: children || 'children'
};
var childrenListMap = {};
var nodeIds = {};
var tree = [];
var childrenListMap = {};
var nodeIds = {};
var tree = [];
for (let d of data) {
let parentId = d[config.parentId];
if (childrenListMap[parentId] == null) {
childrenListMap[parentId] = [];
}
nodeIds[d[config.id]] = d;
childrenListMap[parentId].push(d);
}
for (let d of data) {
let parentId = d[config.parentId];
if (childrenListMap[parentId] == null) {
childrenListMap[parentId] = [];
}
nodeIds[d[config.id]] = d;
childrenListMap[parentId].push(d);
}
for (let d of data) {
let parentId = d[config.parentId];
if (nodeIds[parentId] == null) {
tree.push(d);
}
}
for (let d of data) {
let parentId = d[config.parentId];
if (nodeIds[parentId] == null) {
tree.push(d);
}
}
for (let t of tree) {
adaptToChildrenList(t);
}
for (let t of tree) {
adaptToChildrenList(t);
}
function adaptToChildrenList(o) {
if (childrenListMap[o[config.id]] !== null) {
o[config.childrenList] = childrenListMap[o[config.id]];
}
if (o[config.childrenList]) {
for (let c of o[config.childrenList]) {
adaptToChildrenList(c);
}
}
}
return tree;
function adaptToChildrenList(o) {
if (childrenListMap[o[config.id]] !== null) {
o[config.childrenList] = childrenListMap[o[config.id]];
}
if (o[config.childrenList]) {
for (let c of o[config.childrenList]) {
adaptToChildrenList(c);
}
}
}
return tree;
}
Loading…
Cancel
Save