对接问题知识库

This commit is contained in:
qq787203167
2022-08-09 16:50:55 +08:00
parent c330cee3a4
commit 474817b841
8 changed files with 359 additions and 35 deletions
+2
View File
@@ -1252,4 +1252,6 @@ module.exports = {
optionDropDownBox:'Option drop - down box',
attachmentUpload:'file',
textInput:'Text Input',
HaveReleased:'Have released',
forward:'Forward',
}
+2
View File
@@ -1355,4 +1355,6 @@ module.exports = {
Paraname: '参数名称',
Parabatch: '参数批次',
freeze:'请选择冻结配置',
HaveReleased:'已发布',
forward:'转发',
}
@@ -0,0 +1,188 @@
<template>
<div>
<a-drawer
:title="title"
:maskClosable="false"
:width="600"
placement="right"
:closable="true"
@close="handleCancel"
:visible="visible"
style="height: 100%;overflow: auto;padding-bottom: 53px;">
<a-spin :spinning="confirmLoading">
<a-input-search style="margin-bottom: 8px" v-model="searchModel"
@search="onSearch"
allowClear
:placeholder="$t('NodeQuickLookup')"/>
<div class="drawer-content">
<a-tree
v-if="visibleTree"
style="margin-bottom: 60px;height: 600px"
checkable
:autoExpandParent="false"
:tree-data="gData"
@select="onSelect"
@check="checkChange"
@expand="onExpand"
:defaultExpandedKeys="defaultExpandedKeys"
>
</a-tree>
</div>
</a-spin>
<div class="drawer-bootom-button">
<a-button @click="handleCancel" type="danger" style="margin-right: 16px">{{$t('cancel')}}</a-button>
<a-button @click="handleSubmit" type="primary" :loading="submitLoading">{{$t('submit')}}</a-button>
</div>
</a-drawer>
</div>
</template>
<script>
import { getAction, postAction } from '@/api/manage'
import eventBUs from '../../common/event'
export default {
name: 'index',
props: {
url: {
type: Object,
default: {}
},
title:{
type: String,
default:''
},
},
data() {
return {
gData: [],
searchModel: '',
autoExpandParent: true,
expandedKeys: [],
visible: false,
confirmLoading: false,
selectedKey: [],
tableKey: [],
userIds: [],
departId: '',
defaultExpandedKeys: [],
submitLoading: false,
visibleTree: false
}
},
mounted() {
},
methods: {
getPush() {
this.searchModel = ''
this.visible = true
this.visibleTree = false
this.$nextTick(() => {
this.departId = ''
this.queryDepartUserTreeList()
})
},
onSelect(selectedKeys) {
this.selectedKey = selectedKeys
},
onExpand(selectedKeys, val) {
if (this.searchModel == '' || !this.searchModel) {
if (val.expanded) {
if (this.departId == val.node.value) {
} else {
this.departId = val.node.value
this.queryDepartUserTreeList()
}
}
}
},
handleCancel() {
this.visible = false
this.visibleTree = false
},
handleSubmit() {
this.$emit('SelectedByForm',this.userIds.join(','))
},
onSearch(e) {
this.gData = []
this.departId = ''
this.visibleTree = false
if (e) {
this.getUserAndDepart()
} else {
this.queryDepartUserTreeList()
}
},
getUserAndDepart() {
getAction('sys/user/getUserAndDepart', { name: this.searchModel }).then((res) => {
this.gData = res || []
this.visibleTree = true
})
},
queryDepartUserTreeList() {
let gData = JSON.parse(JSON.stringify(this.gData))
if (gData && gData.length > 0) {
gData = JSON.stringify(gData)
} else {
gData = ''
}
this.confirmLoading = true
postAction('sys/user/queryDepartUserTreeList', {
departId: this.departId,
json: gData
}).then((res) => {
this.confirmLoading = false
if (res.success) {
this.gData = res.result
this.defaultExpandedKeys = [this.departId]
this.visibleTree = true
} else {
this.gData = []
}
})
},
checkChange(e) {
this.userIds = e
}
}
}
</script>
<style scoped>
.box-title-text {
line-height: 1.4;
display: flex;
}
.box-input {
display: inline-block;
height: 38px;
width: 100%;
}
.button-box {
margin-left: 10px;
height: 38px;
line-height: 38px;
}
.drawer-bootom-button {
position: absolute;
bottom: 0;
z-index:100;
width: 100%;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
text-align: right;
left: 0;
background: #fff;
border-radius: 0 0 2px 2px;
}
.drawer-content {
height: calc(100% - 60px);
overflow: auto;
}
</style>
@@ -8,8 +8,17 @@
<div class="title-text" :title="$t('applicableMarket')">
<span>{{$t('applicableMarket')}}</span>
</div>
<a-input class="box-input" :placeholder="$t('PleaseEnter')+$t('applicableMarket')"
v-model="queryParam.applicableMarket"></a-input>
<a-select :placeholder="$t('PleaseSelect')+$t('applicableMarket')"
:disabled="false"
v-model="queryParam.applyMarket">
<a-select-option v-for="(item, key) in applyMarketList"
:key="key"
:value="item.value">
<span style="display: inline-block;width: 100%" :title=" item.title ">
{{ item.title}}
</span>
</a-select-option>
</a-select>
</div>
</a-col>
<span style="float: right;overflow: hidden;margin-right: 11px" class="table-page-search-submitButtons">
@@ -89,15 +98,25 @@
return {
queryParam: {},
conList: [],
applyMarketList: [],
pageSize: 10,
total: 0,
pageNo: 1
}
},
mounted() {
this.getApplyMarketList()
},
methods: {
getApplyMarketList() {
getAction('/problemKnowledgeBase/countryCardManageReleaseEO/getApplyMarketList', { queryFlag: 'countryCard' }).then((res) => {
if (res.success) {
this.applyMarketList = res.result || []
} else {
this.applyMarketList = []
}
})
},
searchQuery() {
},
@@ -19,8 +19,10 @@
<div class="title-text" :title="$t('applicableMarket')">
<span>{{$t('applicableMarket')}}</span>
</div>
<a-input class="box-input" :placeholder="$t('PleaseEnter')+$t('applicableMarket')"
v-model="queryParam.applicableMarket"></a-input>
<j-dict-select-tag class="box-input" v-model="queryParam.applyMarket"
:placeholder="$t('PleaseSelect')+$t('applicableMarket')"
:type="'select'"
:triggerChange="false" :dictCode="'region'"/>
</div>
</a-col>
<a-col :md="6" :sm="8">
@@ -28,8 +30,18 @@
<div class="title-text" :title="$t('releaseStatus')">
<span>{{$t('releaseStatus')}}</span>
</div>
<a-input class="box-input" :placeholder="$t('PleaseEnter')+$t('releaseStatus')"
v-model="queryParam.releaseStatus"></a-input>
<a-select class="box-input"
:placeholder="$t('PleaseSelect')+$t('releaseStatus')"
style="width: 100%"
v-model="queryParam.releaseStatus">
<a-select-option v-for="(item, key) in releaseStatusList"
:key="key"
:value="item.value">
<span style="display: inline-block;width: 100%" :title=" item.name ">
{{ item.name}}
</span>
</a-select-option>
</a-select>
</div>
</a-col>
<span style="float: right;overflow: hidden;margin-right: 11px" class="table-page-search-submitButtons">
@@ -74,8 +86,10 @@
{{!record.releaseStatus || record.releaseStatus == 'Draft' ? $t('release') :$t('withdraw')}}
</a>
<a class="text-operation"
v-if="record.createBy == userInfoQuery.username && record.releaseStatus == 'Draft'"
@click="edit(record)">{{$t('edit')}}</a>
<a class="text-operation"
v-if="record.createBy == userInfoQuery.username && record.releaseStatus == 'Draft'"
@click="deleteData(record)">{{$t('delete')}}</a>
</span>
</a-table>
@@ -104,6 +118,7 @@
import { getAction, postAction, deleteAction, downloadFile } from '@/api/manage'
import countryCardReleaseModel from './countryCardReleaseModel'
import countryCardReleaseAdd from './countryCardReleaseAdd'
import { mapGetters } from 'vuex'
export default {
name: 'countryCardRelease',
@@ -114,8 +129,19 @@
data() {
return {
queryParam: {},
releaseStatusList: [
{
value: 'Draft',
name: this.$t('draft')
},
{
value: 'Have released',
name: this.$t('HaveReleased')
}
],
loading: false,
dataSource: [{}],
dataSource: [],
selectedRowKeysRecord: [],
total: 0,
pageSize: 10,
pageNo: 1,
@@ -123,12 +149,13 @@
list: '/problemKnowledgeBase/countryCardManageReleaseEO/page',
deleteBatch: '/problemKnowledgeBase/countryCardManageReleaseEO/deleteBatch'
},
userInfoQuery: {},
selectedRowKeys: [],
columns: [
{
title: this.$t('applicableMarket'),
align: 'center',
dataIndex: 'applyMarket',
dataIndex: 'applyMarket_dictText',
ellipsis: true
},
{
@@ -150,8 +177,10 @@
mounted() {
document.title = 'Country Card-' + this.$t('managePublishing')
this.getList()
this.userInfoQuery = this.userInfo()
},
methods: {
...mapGetters(['userInfo']),
searchQuery() {
this.pageNo = 1
this.getList()
@@ -197,8 +226,9 @@
}
})
},
onSelectChange(value) {
onSelectChange(value, record) {
this.selectedRowKeys = value
this.selectedRowKeysRecord = record
},
newlyAddedClick() {
this.$refs.countryCardReleaseAddRef.add()
@@ -212,16 +242,27 @@
this.$confirm({
content: _this.$t('ConfirmBatchDeletion'),
onOk() {
let idList = JSON.parse(JSON.stringify(_this.selectedRowKeys))
getAction(_this.url.deleteBatch, { ids: idList.join(',') }).then((res) => {
if (res.success) {
_this.$message.success(_this.$t('OperationSuccessful'))
_this.selectedRowKeys = []
_this.getList()
} else {
_this.$message.warning(res.message)
let idList = []
let selectedRowKeysRecord = JSON.parse(JSON.stringify(_this.selectedRowKeysRecord))
for (let i = 0; i < selectedRowKeysRecord.length; i++) {
if (selectedRowKeysRecord[i].createBy == _this.userInfo().username &&
selectedRowKeysRecord[i].releaseStatus == 'Draft') {
idList.push(selectedRowKeysRecord[i].id)
}
})
}
if (idList.length > 0) {
deleteAction(_this.url.deleteBatch, { ids: idList.join(',') }).then((res) => {
if (res.success) {
_this.$message.success(_this.$t('OperationSuccessful'))
_this.selectedRowKeys = []
_this.getList()
} else {
_this.$message.warning(res.message)
}
})
} else {
_this.$message.warning(_this.$t('doNotHavePermissionDeleteData'))
}
}
})
} else {
@@ -10,7 +10,7 @@
:visible="visible"
style="height: 100%;overflow: auto;padding-bottom: 53px;">
<a-form-model :model="formInline" class="formAdd" :rules="rules" ref="ruleForm">
<a-row :gutter="24">
<a-row :gutter="24" v-if="title == $t('newlyAdded')">
<a-col :span="12">
<div class="box-title-text">
<div class="title-text">
@@ -20,6 +20,7 @@
</div>
<a-form-model-item class="itemModel" prop="applyMarket">
<a-select :placeholder="$t('PleaseSelect')+$t('applicableMarket')"
:disabled="false"
v-model="formInline.applyMarket">
<a-select-option v-for="(item, key) in applyMarketList"
:key="key"
@@ -33,6 +34,23 @@
</div>
</a-col>
</a-row>
<a-row :gutter="24" v-if="title == $t('edit')">
<a-col :span="12">
<div class="box-title-text">
<div class="title-text">
<span class="title-text-text"
:title="$t('applicableMarket')">{{$t('applicableMarket')}}</span>
</div>
<a-form-model-item class="itemModel">
<j-dict-select-tag class="box-input" v-model="formInline.applyMarket"
:disabled="true"
:placeholder="$t('PleaseSelect')+$t('applicableMarket')"
:type="'select'"
:triggerChange="false" :dictCode="'region'"/>
</a-form-model-item>
</div>
</a-col>
</a-row>
</a-form-model>
<div style="margin-bottom: 60px">
<a-table
@@ -143,15 +161,23 @@
methods: {
add() {
this.visible = true
this.$nextTick(() => {
this.formInline = {}
this.$refs.ruleForm.clearValidate()
})
this.title = this.$t('newlyAdded')
this.replacePage()
this.getApplyMarketList()
},
edit(row) {
this.visible = true
this.$nextTick(() => {
this.formInline = row
this.formInline = { ...this.formInline }
this.$refs.ruleForm.clearValidate()
})
this.title = this.$t('edit')
this.editReplacePage(row)
this.getApplyMarketList()
},
getApplyMarketList() {
getAction('/problemKnowledgeBase/countryCardManageReleaseEO/getApplyMarketList', {}).then((res) => {
@@ -194,20 +220,29 @@
this.$refs.ruleForm.validate(valid => {
if (valid) {
let url = ''
let content = []
if (this.title == this.$t('newlyAdded')) {
url = this.url.add
this.dataList.forEach(res => {
content.push({
countryCardTempId: res.id,
description: res.description,
content: res.content
})
})
} else {
url = this.url.edit
this.dataList.forEach(res => {
content.push({
countryCardTempId: res.id,
description: res.description,
content: res.content,
id: res.id
})
})
}
this.confirmLoading = true
let content = []
this.dataList.forEach(res => {
content.push({
countryCardTempId: res.id,
description: res.description,
content: res.content
})
})
let query = {
countryCardManageReleaseDetailEOList: content,
applyMarket: this.formInline.applyMarket
@@ -240,7 +275,7 @@
},
editReplacePage(row) {
this.loading = true
getAction('/problemKnowledgeBase/countryCardManageReleaseDetailEO/list', { editReplacePage: row.id }).then((res) => {
getAction('/problemKnowledgeBase/countryCardManageReleaseDetailEO/list', { countryCardManageReleaseId: row.id }).then((res) => {
if (res.success) {
this.dataList = res.result || []
this.loading = false
@@ -215,8 +215,7 @@
}
.box-content-left {
width: 60%;
float: left;
width: 100%;
font-size: 14px;
font-weight: 400;
color: #040B29;
@@ -224,8 +223,7 @@
}
.box-content-right {
width: 40%;
float: left;
width: 100%;
display: inline-block;
text-align: right;
margin-top: 20px;
@@ -8,6 +8,12 @@
</span>
{{$t('applicableInstructionsMarketList')}}
</div>
<div class="doc-detail-right">
<div @click="forwardClick" class="operator-text-text" :title="$t('forward')">
<a-icon type="reload"/>
{{$t('forward')}}
</div>
</div>
</div>
<div style="padding-top: 68px;background: #fff">
<div class="detail-content" style="padding: 24px">
@@ -77,18 +83,21 @@
</div>
</div>
<viewFileModel ref="viewFileModelRef"/>
<SelectedBy ref="SelectedByRef" :title="$t('forward')" @SelectedByForm="SelectedByForm"></SelectedBy>
</div>
</template>
<script>
import viewFileModel from '@/components/viewFileModel/index'
import SelectedBy from '@/components/SelectedBy/index'
import { getAction, postAction, downloadFile, putAction } from '@/api/manage'
import { mapGetters } from 'vuex'
export default {
name: 'problemKnowledgeBaseView',
components: {
viewFileModel
viewFileModel,
SelectedBy
},
data() {
return {
@@ -140,6 +149,9 @@
},
methods: {
...mapGetters(['userInfo']),
SelectedByForm() {
},
queryById() {
let query = {
id: this.$route.query.id
@@ -251,6 +263,9 @@
this.loading = false
}
})
},
forwardClick() {
this.$refs.SelectedByRef.getPush()
}
}
}
@@ -454,4 +469,28 @@
.header-btn {
height: 38px;
}
.doc-detail-right {
width: 800px;
line-height: 68px;
display: flex;
justify-content: end;
padding-right: 30px;
.doc-detail-btn {
margin-right: 20px;
}
}
.operator-text-text {
cursor: pointer;
font-size: 14px;
font-weight: 400;
color: #040B29;
display: inline-block;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
text-align: right;
}
</style>