Compare commits

...

4 Commits

7 changed files with 174 additions and 71 deletions

View File

@ -483,7 +483,6 @@ export default {
-webkit-box-sizing: border-box;
box-sizing: border-box;
line-height: 32px;
background: pink;
width: 120px;
}

View File

@ -31,7 +31,8 @@
基本信息
</div>
<el-form-item label="名称" prop="name">
<el-input v-model="dataForm.name" placeholder="请输入名称" :disabled="modalType === 'display'" style="width:90%"></el-input>
<el-input v-model="dataForm.name" placeholder="请输入名称" :disabled="modalType === 'display'"
style="width:90%"></el-input>
</el-form-item>
<el-form-item label="描述" prop="description">
<el-input type="textarea" :rows="3" v-model="dataForm.description" placeholder="请输入描述" style="width:90%"
@ -46,6 +47,13 @@
</integrated-combine-ability>
</div>
<!-- 更多能力 -->
<div class="" style="marigin-bottom:40px" v-show="checkList.includes('更多能力')">
<common-question :dataForm="dataForm" @update="updateDataForm" ref="commonQuestion" title="更多能力"
:keyTextObj="moreKeyTextObj">
</common-question>
</div>
<!-- 使用步骤 -->
<div style="marigin-bottom:20px" v-show="checkList.includes('使用步骤')">
<scene-use-step :dataForm="dataForm" @update="updateDataForm" :disabledType="modalType === 'display'"
@ -96,16 +104,28 @@ import qs from "qs";
import SceneUseStep from '../components/scene-use-step.vue';
import IntegratedCombineAbility from '../components/integrated-combine-ability.vue';
import Cookies from 'js-cookie'
import CommonQuestion from '../components/common-question.vue';
export default {
components: {
SceneUseStep,
IntegratedCombineAbility,
CommonQuestion,
},
data() {
return {
fileList: [],
fileUploadUrl: `${window.SITE_CONFIG['apiURL']}/sys/oss/upload?token=${Cookies.get('ucsToken')}`,
moreKeyTextObj: {
nameObj: {
text: '能力名称',
key: 'name'
},
descObj: {
text: '能力描述',
key: 'description'
},
},
dataForm: {
"applicationArea": "",
"description": "",
@ -113,7 +133,11 @@ export default {
{
"attrType": "使用步骤",
"attrValue": [{ question: "", answer: "" }],
}
},
{
"attrType": "更多能力",
"attrValue": [{ name: "", description: "" }],
},
],
"fuseResourceList": [
{
@ -155,13 +179,18 @@ export default {
key: 'combine',
show: true,
},
{
name: '更多能力',
key: 'more',
show: true,
},
{
name: '使用步骤',
key: 'basic',
show: true,
},
],
checkList: ['基本信息', '关联能力', '使用步骤'],
checkList: ['基本信息', '关联能力', '更多能力', '使用步骤'],
areaList: [],
addOrUpdateVisibleCopy: this.addOrUpdateVisible,
displayInfo: {
@ -170,7 +199,8 @@ export default {
},
displayListInfo: {
'使用步骤': [],
'关联能力': []
'关联能力': [],
'更多能力': [],
},
modalTypeText: {
add: '挂接',
@ -216,16 +246,26 @@ export default {
},
//
updateDataForm(data) {
if (data.title == '使用步骤') {
if (data.title == '关联能力') {
this.dataForm.fuseResourceList = data.list
} else {
// 使
this.operateFuseAttrList(data.title, data)
}
},
operateFuseAttrList(title, data) {
if (this.dataForm.fuseAttrList.every(v => v.attrType !== title)) {
this.dataForm.fuseAttrList.push({
'attrType': title,
'attrValue': JSON.stringify(data.list)
})
} else {
this.dataForm.fuseAttrList.map(v => {
if (v.attrType === '使用步骤') {
if (v.attrType === title) {
v.attrValue = JSON.stringify(data.list)
}
})
}
if (data.title == '关联能力') {
this.dataForm.fuseResourceList = data.list
}
},
//
changeBtn(data) {
@ -281,28 +321,30 @@ export default {
this.$nextTick(() => {
this.$refs.combineAbility && this.$refs.combineAbility.getDataInfo(data)
this.$refs.sceneUseUp && this.$refs.sceneUseUp.getDataInfo(data)
this.$refs.commonQuestion && this.$refs.commonQuestion.getDataInfo(data)
console.log('this.dataForm----详情-------->', this.dataForm);
})
},
//
getDisPlayData() {
this.$nextTick(() => {
const questionObj = this.dataForm.fuseAttrList.find(v => v.attrType == '使用步骤') || {};
let fuseResourceList = this.dataForm.fuseResourceList || [];
let arr = []
fuseResourceList.map(v => {
if (v.resource) {
arr.push({
name: v.resource.name,
type: v.resource.type,
})
}
})
this.displayListInfo['使用步骤'] = JSON.parse(questionObj.attrValue || '[]')
this.displayListInfo['关联能力'] = arr
})
},
// getDisPlayData() {
// this.$nextTick(() => {
// const stepObj = this.dataForm.fuseAttrList.find(v => v.attrType == '使') || {};
// const moreObj = this.dataForm.fuseAttrList.find(v => v.attrType == '') || {};
// let fuseResourceList = this.dataForm.fuseResourceList || [];
// let arr = []
// fuseResourceList.map(v => {
// if (v.resource) {
// arr.push({
// name: v.resource.name,
// type: v.resource.type,
// })
// }
// })
// this.displayListInfo['使'] = JSON.parse(stepObj.attrValue || '[]')
// this.displayListInfo[''] = JSON.parse(moreObj.attrValue || '[]')
// this.displayListInfo[''] = arr
// })
// },
},
beforeDestroy() {
this.clearForm()
@ -403,7 +445,6 @@ export default {
-webkit-box-sizing: border-box;
box-sizing: border-box;
line-height: 32px;
background: pink;
width: 120px;
}

View File

@ -1,14 +1,17 @@
<template>
<div class="question-box">
<div class="title">
常见问题
{{ title }}
</div>
<div v-for="(item, index) in dataInfo" :key="index">
<el-form-item label="问题名称" prop="question">
<el-input v-model="item.question" placeholder="请输入问题名称" style="width:90%"></el-input>
<el-form-item :label="keyTextObj.nameObj.text">
<el-input v-model="item[keyTextObj.nameObj.key]" :placeholder="`请输入${keyTextObj.nameObj.text}`"
style="width:90%">
</el-input>
</el-form-item>
<el-form-item label="问题描述" prop="question">
<el-input type="textarea" :rows="2" v-model="item.answer" placeholder="请输入问题描述" style="width:90%">
<el-form-item :label="keyTextObj.descObj.text">
<el-input type="textarea" :rows="2" v-model="item[keyTextObj.descObj.key]"
:placeholder="`请输入${keyTextObj.descObj.text}`" style="width:90%">
</el-input>
<el-button style="margin-left:10px" @click="deleteItem(index)" type="danger" size="small"
v-if="dataInfo.length > 1">删除
@ -26,6 +29,25 @@ export default {
dataForm: {
type: Object,
default: () => { }
},
title: {
type: String,
default: '常见问题'
},
keyTextObj: {
type: Object,
default: () => {
return {
nameObj: {
text: '问题名称',
key: 'question'
},
descObj: {
text: '问题描述',
key: 'answer'
},
}
}
}
},
data() {
@ -38,7 +60,7 @@ export default {
handler(newVal) {
this.dataInfo = newVal;
this.$emit('update', {
title: '常见问题',
title: this.title,
list: newVal
})
},
@ -51,21 +73,29 @@ export default {
let arr = []
if (dataForm && (dataForm.id || dataForm.id === 0)) {
let fuseAttrList = dataForm.fuseAttrList || [];
let obj = fuseAttrList.find(v => v.attrType === '常见问题') || {}
let obj = fuseAttrList.find(v => v.attrType === this.title) || {}
let attrValue = JSON.parse(obj.attrValue || "[]")
if (attrValue.length > 0) {
attrValue.map(v => {
arr.push({
question: v.question,
answer: v.answer,
[this.keyTextObj.nameObj.key]: v[this.keyTextObj.nameObj.key],
[this.keyTextObj.descObj.key]: v[this.keyTextObj.descObj.key],
})
})
} else {
arr = []
console.log('this.keyTextObj.nameObj.key------------>', this.keyTextObj.nameObj.key);
arr.push({
[this.keyTextObj.nameObj.key]: '',
[this.keyTextObj.descObj.key]: '',
})
}
} else {
arr = []
console.log('this.keyTextObj.nameObj.key------------>', this.keyTextObj.nameObj.key);
arr.push({
question: "",
answer: "",
[this.keyTextObj.nameObj.key]: '',
[this.keyTextObj.descObj.key]: '',
})
}
this.dataInfo = arr;
@ -73,8 +103,8 @@ export default {
//
addItem() {
this.dataInfo.push({
question: "",
answer: "",
[this.keyTextObj.nameObj.key]: '',
[this.keyTextObj.descObj.key]: '',
})
},
//

View File

@ -8,12 +8,13 @@
<div class="wrapper">
<div class="content">
<div class="left">{{ item.createDate }}</div>
<el-tooltip effect="dark" :content="item.title" placement="top">
<el-tooltip popper-class="testTooltip" effect="dark" :content="item.title" placement="top">
<div class="right ellipsis">{{ item.title || '--' }}</div>
</el-tooltip>
</div>
</div>
</div>
<div class="more" @click="jumpTo">查看更多 ></div>
</div>
</div>
@ -34,7 +35,7 @@ export default {
components: {
contentTitle
},
data () {
data() {
return {
title: { dynamic: '部门发布动态', recommend: '部门推荐能力' },
list: [],
@ -76,13 +77,13 @@ export default {
loadingTable: false
}
},
mounted () {
mounted() {
this.getResourceByDept()
this.getApplyByDept()
},
methods: {
//
getResourceByDept () {
getResourceByDept() {
const data = {
limit: 5,
page: 1
@ -108,7 +109,7 @@ export default {
)
},
//
getApplyByDept () {
getApplyByDept() {
const data = {
limit: 5,
page: 1
@ -130,7 +131,12 @@ export default {
console.log('err', err)
}
)
}
},
jumpTo() {
this.$router.push({
path: 'activiti-my-work-dynamics'
});
},
}
}
</script>
@ -153,7 +159,8 @@ export default {
background: #fff;
width: 800px;
height: 335px;
padding: 0px 0 20px 10px;
padding: 0px 0 0 10px;
box-sizing: border-box;
}
}
@ -171,7 +178,7 @@ export default {
margin-bottom: 7px;
.wrapper {
height: 50px;
height: 45px;
width: 770px;
display: flex;
flex-direction: row;
@ -199,7 +206,7 @@ export default {
}
.right {
font-size: 18px;
font-size: 16px;
color: #464645;
width: 600px;
}
@ -207,6 +214,16 @@ export default {
}
}
.more {
cursor: pointer;
text-align: right;
padding-top: 4px;
display: inline-block;
width: 100%;
color: #2b2b2b;
font-size: 14px;
}
.recommendView {
cursor: pointer;
width: 770px;
@ -220,3 +237,8 @@ export default {
background-color: #f4f5f8;
}
</style>
<style lang="scss">
.testTooltip {
width: 670px !important;
}
</style>

View File

@ -42,12 +42,7 @@ export default {
handler(newVal, oldVal) {
if (newVal) {
this.dataListCopy = newVal;
if (document.getElementById(this.id)) {
//
setTimeout(() => {
this.initChart()
}, 2000)
}
this.initChart()
}
},
deep: true,
@ -55,9 +50,6 @@ export default {
},
},
mounted() {
setTimeout(() => {
this.initChart()
}, 2000)
},
methods: {
initChart() {
@ -68,7 +60,6 @@ export default {
this.myChart = chartDom && echarts.init(chartDom);
let lengendArr = this.dataListCopy.filter(v => v.name);
let total = 0;
this.dataListCopy.map(v => {
if (v.value || v.value === 0) {

View File

@ -12,16 +12,26 @@
</div>
</div>
<div class="list-box" v-if="dataInfo.list.length > 0">
<div v-for="(item, i) in dataInfo.list" :key="i">
<el-tooltip effect="dark" :content="item[dataInfo.nameStr]" placement="top">
<!-- 待办 -->
<el-tooltip effect="dark" v-if="dataInfo.type === 'todo'"
:content="`${(item.processDefinitionName || '--')}${item.taskName ? ('—' + item.taskName) : ''}`"
placement="top">
<div class="list-item ellipsis">
{{ item[dataInfo.nameStr] || '--' }}
{{ `${(item.processDefinitionName || '--')}${item.taskName ? ('—' + item.taskName) : ''}` }}
</div>
</el-tooltip>
<!-- 已办 -->
<el-tooltip effect="dark" v-else
:content="`${(item.processDefinitionName || '--')}${item.resourceName ? ('—' + item.resourceName) : ''}`"
placement="top">
<div class="list-item ellipsis">
{{ `${(item.processDefinitionName || '--')}${item.resourceName ? ('—' + item.resourceName) :
''}`
}}
</div>
</el-tooltip>
</div>
<div class="more" @click="goPage(dataInfo.url)">
查看更多 >
</div>

View File

@ -9,13 +9,13 @@
</div>
<div class="flex-row-start dept-chart-box">
<dept-chart-view id="shelves" title="部门上架" v-loading="loadingResource" :dataList="resourceData"
:colorArray="resourceColor">
ref="resourceChart" :colorArray="resourceColor">
</dept-chart-view>
<dept-chart-view id="apply" title="部门申请" v-loading="loadingApply" :dataList="applyData"
<dept-chart-view id="apply" title="部门申请" v-loading="loadingApply" :dataList="applyData" ref="applyChart"
:colorArray="applyColor">
</dept-chart-view>
<dept-chart-view id="demand" title="部门需求" v-loading="loadingRequire" :dataList="requireData"
:colorArray="requireColor">
ref="requireChart" :colorArray="requireColor">
</dept-chart-view>
</div>
</div>
@ -54,7 +54,7 @@ export default {
textColor: '#f86f01',
num: 0,
list: [],
nameStr: 'taskName',
type: 'todo',
url: 'activiti-my-todo-task'
},
//
@ -67,7 +67,6 @@ export default {
textColor: '#21b107',
num: 0,
list: [],
nameStr: 'processDefinitionName',
url: 'activiti-my-join-task'
},
//
@ -134,6 +133,7 @@ export default {
console.log('res----已办-------->', res.data);
this.hasToDodoData.list = res.data.data.records || []
this.hasToDodoData.num = res.data.data.total || 0
}, err => {
this.$message.error(err)
this.loadingHasToDo = false;
@ -150,6 +150,9 @@ export default {
}
console.log('res----部门上架-------->', res.data);
this.resourceData = this.formatList(res.data.data.total || [])
this.$nextTick(() => {
this.$refs.resourceChart.initChart(this.resourceData)
})
}, err => {
this.$message.error(err)
this.loadingResource = false;
@ -165,6 +168,10 @@ export default {
}
console.log('res----部门申请-------->', res.data);
this.applyData = this.formatList(res.data.data.total || [])
this.$nextTick(() => {
console.log('this.applyData------------>', this.applyData);
this.$refs.applyChart.initChart(this.applyData)
})
}, err => {
this.$message.error(err)
this.loadingApply = false;
@ -190,6 +197,9 @@ export default {
}
console.log('res----部门需求-------->', res.data);
this.requireData = this.formatList(res.data.data.total || [], 'flag')
this.$nextTick(() => {
this.$refs.requireChart.initChart(this.requireData)
})
}, err => {
this.$message.error(err)