Merge remote-tracking branch 'origin/dev_third_stage' into dev_third_stage

This commit is contained in:
zyx.net
2022-08-09 10:22:53 +08:00
4 changed files with 99 additions and 37 deletions
+3
View File
@@ -1249,4 +1249,7 @@ module.exports = {
Paraname: 'Para Name', Paraname: 'Para Name',
Parabatch: 'Para Batch', Parabatch: 'Para Batch',
freeze:'Please select the configuration you want to freeze', freeze:'Please select the configuration you want to freeze',
optionDropDownBox:'Option drop - down box',
attachmentUpload:'file',
textInput:'Text Input',
} }
+3
View File
@@ -1349,6 +1349,9 @@ module.exports = {
punctuationmark:'只能输入除#号和逗号外的英文标点符号', punctuationmark:'只能输入除#号和逗号外的英文标点符号',
created: '创建时间', created: '创建时间',
updated:'更新时间', updated:'更新时间',
optionDropDownBox:'下拉选择',
attachmentUpload:'附件上传',
textInput:'文本输入',
Paraname: '参数名称', Paraname: '参数名称',
Parabatch: '参数批次', Parabatch: '参数批次',
freeze:'请选择冻结配置', freeze:'请选择冻结配置',
@@ -24,7 +24,12 @@
:loading="loading"> :loading="loading">
<span slot="operation" slot-scope="text,record"> <span slot="operation" slot-scope="text,record">
<a style="margin-right: 8px" @click="edit(record)">{{$t('edit')}}</a> <a style="margin-right: 8px" @click="edit(record)">{{$t('edit')}}</a>
<a @click="deleteData">{{$t('delete')}}</a> <a @click="deleteData(record)">{{$t('delete')}}</a>
</span>
<span slot="lableType" slot-scope="text,record">
<span v-if="text == 3">{{$t('optionDropDownBox')}}</span>
<span v-if="text == 7">{{$t('attachmentUpload')}}</span>
<span v-if="text == 8">{{$t('textInput')}}</span>
</span> </span>
</a-table> </a-table>
<div class="page" v-if="dataList.length > 0"> <div class="page" v-if="dataList.length > 0">
@@ -51,7 +56,7 @@
</template> </template>
<script> <script>
import { getAction, postAction, downloadFile,deleteAction } from '@/api/manage' import { getAction, postAction, downloadFile, deleteAction } from '@/api/manage'
import countryCardReleaseModelAdd from './countryCardReleaseModelAdd' import countryCardReleaseModelAdd from './countryCardReleaseModelAdd'
export default { export default {
@@ -62,12 +67,12 @@
data() { data() {
return { return {
url: { url: {
list: '', list: '/problemKnowledgeBase/countryCardTempEO/page',
deleteOne: '' deleteOne: '/problemKnowledgeBase/countryCardTempEO/deleteBatch'
}, },
visible: false, visible: false,
selectedRowKeys: [], selectedRowKeys: [],
dataList: [{}], dataList: [],
loading: false, loading: false,
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
@@ -75,21 +80,22 @@
columns: [ columns: [
{ {
title: this.$t('LabelName'), title: this.$t('LabelName'),
dataIndex: 'LabelName', dataIndex: 'lableName',
align: 'center', align: 'center',
ellipsis: true, ellipsis: true,
width: 200 width: 200
}, },
{ {
title: this.$t('LabelType'), title: this.$t('LabelType'),
dataIndex: 'LabelType', dataIndex: 'lableType',
align: 'center', align: 'center',
ellipsis: true, ellipsis: true,
width: 200 width: 200,
scopedSlots: { customRender: 'lableType' }
}, },
{ {
title: this.$t('DisplayOrder'), title: this.$t('DisplayOrder'),
dataIndex: 'DisplayOrder', dataIndex: 'orderNum',
align: 'center', align: 'center',
ellipsis: true, ellipsis: true,
width: 160 width: 160
@@ -109,6 +115,8 @@
methods: { methods: {
getData() { getData() {
this.visible = true this.visible = true
this.pageNo = 1
this.replacePage()
}, },
handleCancel() { handleCancel() {
this.visible = false this.visible = false
@@ -132,10 +140,10 @@
this.$confirm({ this.$confirm({
content: _this.$t('ConfirmDelete'), content: _this.$t('ConfirmDelete'),
onOk() { onOk() {
deleteAction(_this.url.deleteOne, { id: val.id }).then((res) => { deleteAction(_this.url.deleteOne, { ids: val.id }).then((res) => {
if (res.success) { if (res.success) {
_this.$message.success(_this.$t('OperationSuccessful')) _this.$message.success(_this.$t('OperationSuccessful'))
_this.getList() _this.replacePage()
} else { } else {
_this.$message.warning(_this.$t('operationFailed')) _this.$message.warning(_this.$t('operationFailed'))
} }
@@ -158,7 +166,7 @@
pageSize: this.pageSize pageSize: this.pageSize
} }
this.loading = true this.loading = true
postAction(this.url.list, query).then((res) => { getAction(this.url.list, query).then((res) => {
if (res.success) { if (res.success) {
this.dataList = res.result.records || [] this.dataList = res.result.records || []
this.total = res.result.total this.total = res.result.total
@@ -18,10 +18,10 @@
<span class="title-text-text" <span class="title-text-text"
:title="$t('LabelName')">{{$t('LabelName')}}</span> :title="$t('LabelName')">{{$t('LabelName')}}</span>
</div> </div>
<a-form-model-item class="itemModel" prop="LabelName"> <a-form-model-item class="itemModel" prop="lableName">
<a-input class="box-input" <a-input class="box-input"
:disabled="disabled" :disabled="disabled"
v-model="formInline.LabelName" v-model="formInline.lableName"
:placeholder="$t('PleaseEnter')+$t('LabelName')"/> :placeholder="$t('PleaseEnter')+$t('LabelName')"/>
</a-form-model-item> </a-form-model-item>
</div> </div>
@@ -35,20 +35,26 @@
<span class="title-text-text" <span class="title-text-text"
:title="$t('LabelType')">{{$t('LabelType')}}</span> :title="$t('LabelType')">{{$t('LabelType')}}</span>
</div> </div>
<a-form-model-item class="itemModel" prop="LabelType"> <a-form-model-item class="itemModel" prop="lableType">
<a-input class="box-input" <a-select :placeholder="$t('PleaseSelect')+$t('LabelType')"
:disabled="disabled" @change="lableTypeChange"
v-model="formInline.LabelType" v-model="formInline.lableType">
:placeholder="$t('PleaseEnter')+$t('LabelType')"/> <a-select-option v-for="(item, key) in lableTypeList"
:key="key"
:value="item.value">
<span style="display: inline-block;width: 100%" :title=" item.name ">
{{ item.name}}
</span>
</a-select-option>
</a-select>
</a-form-model-item> </a-form-model-item>
</div> </div>
</a-col> </a-col>
</a-row> </a-row>
<a-row :gutter="24"> <a-row :gutter="24" v-if="isDisplay">
<a-col :span="24"> <a-col :span="24">
<div class="box-title-text"> <div class="box-title-text">
<div class="title-text"> <div class="title-text">
<span class="Required">*</span>
<span class="title-text-text" <span class="title-text-text"
:title="$t('dropDownOptions')">{{$t('dropDownOptions')}}</span> :title="$t('dropDownOptions')">{{$t('dropDownOptions')}}</span>
</div> </div>
@@ -68,10 +74,10 @@
<span class="title-text-text" <span class="title-text-text"
:title="$t('DisplayOrder')">{{$t('DisplayOrder')}}</span> :title="$t('DisplayOrder')">{{$t('DisplayOrder')}}</span>
</div> </div>
<a-form-model-item class="itemModel" prop="DisplayOrder"> <a-form-model-item class="itemModel" prop="orderNum">
<a-input-number class="box-input" <a-input-number class="box-input"
:disabled="disabled" :disabled="disabled"
v-model="formInline.DisplayOrder" v-model="formInline.orderNum"
:placeholder="$t('PleaseEnter')+$t('DisplayOrder')"/> :placeholder="$t('PleaseEnter')+$t('DisplayOrder')"/>
</a-form-model-item> </a-form-model-item>
</div> </div>
@@ -84,10 +90,10 @@
<span class="title-text-text" <span class="title-text-text"
:title="$t('associatedWebsite')">{{$t('associatedWebsite')}}</span> :title="$t('associatedWebsite')">{{$t('associatedWebsite')}}</span>
</div> </div>
<a-form-model-item class="itemModel" prop="associatedWebsite"> <a-form-model-item class="itemModel" prop="relevantUrl">
<a-input class="box-input" <a-input class="box-input"
:disabled="disabled" :disabled="disabled"
v-model="formInline.associatedWebsite" v-model="formInline.relevantUrl"
:placeholder="$t('PleaseEnter')+$t('associatedWebsite')"/> :placeholder="$t('PleaseEnter')+$t('associatedWebsite')"/>
</a-form-model-item> </a-form-model-item>
</div> </div>
@@ -100,11 +106,11 @@
<span class="title-text-text" <span class="title-text-text"
:title="$t('describe')">{{$t('describe')}}</span> :title="$t('describe')">{{$t('describe')}}</span>
</div> </div>
<a-form-model-item class="itemModel" prop="describe"> <a-form-model-item class="itemModel" prop="description">
<a-textarea <a-textarea
:placeholder="$t('PleaseEnter')+$t('describe')" :placeholder="$t('PleaseEnter')+$t('describe')"
:disabled="disabled" :disabled="disabled"
v-model="formInline.describe" :rows="4"/> v-model="formInline.description" :rows="4"/>
</a-form-model-item> </a-form-model-item>
</div> </div>
</a-col> </a-col>
@@ -131,41 +137,56 @@
disabled: false, disabled: false,
confirmLoading: false, confirmLoading: false,
formInline: {}, formInline: {},
isDisplay: false,
lableTypeList: [
{
name: this.$t('optionDropDownBox'),
value: '3'
},
{
name: this.$t('attachmentUpload'),
value: '7'
},
{
name: this.$t('textInput'),
value: '8'
}
],
rules: { rules: {
LabelName: [ lableName: [
{ {
required: true, required: true,
message: this.$t('personCharge') + this.$t('cannotEmpty'), message: this.$t('LabelName') + this.$t('cannotEmpty'),
trigger: 'blur' trigger: 'blur'
}, },
{ {
max: 100, max: 100,
message: this.$t('personCharge') + this.$t('cannotExceed') + 100 + this.$t('Characters'), message: this.$t('LabelName') + this.$t('cannotExceed') + 100 + this.$t('Characters'),
trigger: 'blur' trigger: 'blur'
} }
], ],
LabelType: [ lableType: [
{ {
required: true, required: true,
message: this.$t('problemLabel') + this.$t('cannotEmpty'), message: this.$t('LabelType') + this.$t('cannotEmpty'),
trigger: 'change' trigger: 'change'
} }
], ],
DisplayOrder: [ orderNum: [
{ {
required: true, required: true,
message: this.$t('DisplayOrder') + this.$t('cannotEmpty'), message: this.$t('DisplayOrder') + this.$t('cannotEmpty'),
trigger: 'blur' trigger: 'blur'
} }
], ],
associatedWebsite: [ relevantUrl: [
{ {
max: 100, max: 100,
message: this.$t('associatedWebsite') + this.$t('cannotExceed') + 100 + this.$t('Characters'), message: this.$t('associatedWebsite') + this.$t('cannotExceed') + 100 + this.$t('Characters'),
trigger: 'blur' trigger: 'blur'
} }
], ],
describe: [ description: [
{ {
max: 300, max: 300,
message: this.$t('describe') + this.$t('cannotExceed') + 300 + this.$t('Characters'), message: this.$t('describe') + this.$t('cannotExceed') + 300 + this.$t('Characters'),
@@ -173,12 +194,23 @@
} }
] ]
}, },
title: '' title: '',
url: {
add: '/problemKnowledgeBase/countryCardTempEO/add',
edit: '/problemKnowledgeBase/countryCardTempEO/edit'
}
} }
}, },
mounted() { mounted() {
}, },
methods: { methods: {
lableTypeChange(event) {
if (event == 3) {
this.isDisplay = true
} else {
this.isDisplay = false
}
},
dropDownOptionsClick() { dropDownOptionsClick() {
this.$refs.optionMaintenanceRef.getData() this.$refs.optionMaintenanceRef.getData()
}, },
@@ -205,7 +237,23 @@
handleOk() { handleOk() {
this.$refs.ruleForm.validate(valid => { this.$refs.ruleForm.validate(valid => {
if (valid) { if (valid) {
let url = ''
if (this.formInline.id) {
url = this.url.edit
} else {
url = this.url.add
}
postAction(url, this.formInline).then((res) => {
if (res.success) {
this.$message.success(this.$t('OperationSuccessful'))
this.visible = false
this.confirmLoading = false
this.$emit('countryCardReleaseModelAddForm')
} else {
this.confirmLoading = false
this.$message.warning(this.$t('operationFailed'))
}
})
} }
}) })
}, },