对接问题知识库

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
@@ -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>