【add】标签管理增加一些页面

This commit is contained in:
fengchenchen
2023-08-16 16:48:03 +08:00
parent 9cc5f6443e
commit 83729f60d3
16 changed files with 793 additions and 81 deletions
+10
View File
@@ -183,4 +183,14 @@ code: {
})
}
},
```
4. 表单使用a-form-model 且内部有v-if存在时,防止校验错位,必须加key值
```html
<a-col :span="24" v-if="isLength">
<a-form-model-item :label="$t('system.tag.fieldLength')" prop="dbLength" key="dbLength">
<a-input-number v-model="form.dbLength" :min="1" :max="200" :placeholder="$t('pleaseEnter') + $t('system.tag.fieldLength')"
style="width: 100%" :formatter="limitNumber" :parser="limitNumber"/>
</a-form-model-item>
</a-col>
```
+2
View File
@@ -59,6 +59,7 @@ const deleteLogList = (params) => postAction('/sys/log/deleteBatch', params)
const addDict = (params) => postAction('/sys/dict/add', params)
const editDict = (params) => postAction('/sys/dict/edit', params)
const treeList = (params) => getAction('/sys/dict/treeList', params)
const queryDictName = (params) => getAction('/sys/dict/queryDictName', params)
const addDictItem = (params) => postAction('/sys/dictItem/add', params)
const editDictItem = (params) => postAction('/sys/dictItem/edit', params)
@@ -137,6 +138,7 @@ export {
addDict,
editDict,
treeList,
queryDictName,
addDictItem,
editDictItem,
doReleaseData,
+17 -1
View File
@@ -17,6 +17,22 @@ module.exports = {
domesticLaws: '国内法规',
foreignStandards: '海外标准',
enterpriseStandards: '企业标准',
clauseSplitting: '条款拆分'
clauseSplitting: '条款拆分',
// 新增模态框中字段
module: '所属模块',
required: '是否必填',
optionContent: '选项内容',
documentLibraryModuleDisplay: '文档库模块展示',
documentLibraryListDisplay: '文档库列表展示',
selectWhetherDisplayList: '请选择是否文档库列表展示',
search: '是否搜索',
displayOtherModules: '其它模块展示',
regulationsListDisplay: '法规清单展示',
selectDisplayListRegulations: '请选择法规清单是否展示',
searchCenterDisplay: '搜索中心展示',
selectSearchCenterDisplayed: '请选择搜索中心是否展示',
selectWhetherRequired: '请选择是否必填',
describe: '描述',
dictionaryConfiguration: '字典配置'
}
}
+18 -1
View File
@@ -17,6 +17,23 @@ module.exports = {
domesticLaws: '国内法规',
foreignStandards: '海外标准',
enterpriseStandards: '企业标准',
clauseSplitting: '条款拆分'
clauseSplitting: '条款拆分',
// 新增模态框中字段
module: '所属模块',
required: '是否必填',
optionContent: '选项内容',
documentLibraryModuleDisplay: '文档库模块展示',
documentLibraryListDisplay: '文档库列表展示',
selectWhetherDisplayList: '请选择是否文档库列表展示',
search: '是否搜索',
displayOtherModules: '其它模块展示',
regulationsListDisplay: '法规清单展示',
selectDisplayListRegulations: '请选择法规清单是否展示',
searchCenterDisplay: '搜索中心展示',
selectSearchCenterDisplayed: '请选择搜索中心是否展示',
selectWhetherRequired: '请选择是否必填',
describe: '描述',
dictionaryConfiguration: '字典配置',
}
}
+6 -6
View File
@@ -26,9 +26,9 @@ export const FieldType = {
TEXT_LINK: { text: '输入框(链接)', value: '11' }
}
export const TagsTypeEnums = {
DOMESTIC_LIST: { text: '国内法规', langKey: '', value: 1 },
FOREIGN_LIST: { text: '海外标准', langKey: '', value: 2 },
ENTERPRISE_LIST: { text: '企业标准', langKey: '', value: 3 },
CLAUSE_SPLITTING_LIST: { text: '条款拆分', langKey: '', value: 4 }
}
export const TagsTypeEnums = new EsEnums({
DOMESTIC_LIST: { text: '国内法规', langKey: 'system.tag.domesticLaws', value: 1 },
FOREIGN_LIST: { text: '海外标准', langKey: 'system.tag.foreignStandards', value: 2 },
ENTERPRISE_LIST: { text: '企业标准', langKey: 'system.tag.enterpriseStandards', value: 3 },
CLAUSE_SPLITTING_LIST: { text: '条款拆分', langKey: 'system.tag.clauseSplitting', value: 4 }
})
+3 -2
View File
@@ -97,7 +97,6 @@ service.interceptors.request.use(config => {
if (token) {
config.headers['X-Access-Token'] = token // 让每个请求携带自定义 token 请根据实际情况自行修改
}
// update-begin--author:sunjianlei---date:20200723---for 如果当前在low-app环境,并且携带了appId,就向Header里传递appId
const $route = router.currentRoute
if ($route && $route.name && $route.name.startsWith('low-app') && $route.params.appId) {
@@ -116,13 +115,15 @@ service.interceptors.request.use(config => {
if (!language) {
language = 'zh-cn'
}
const cut = language === 'zh-cn' ? 'cn' : 'us'
config.headers.language = language
// update-end-author:taoyan date:2020707 for:多租户
if (config.method === 'get') {
if (config.url.indexOf('sys/dict/getDictItems') < 0) {
config.params = {
_t: Date.parse(new Date()) / 1000,
...config.params
...config.params,
cut
}
}
}
+5 -3
View File
@@ -8,7 +8,7 @@
<tag-item></tag-item>
</a-tab-pane>
<a-tab-pane key="2" :tab="$t('system.tag.labelContentManagement')">
<!--<tag-content></tag-content>-->
<tag-content></tag-content>
</a-tab-pane>
</a-tabs>
</div>
@@ -17,12 +17,14 @@
</template>
<script>
import TagItem from './TagItem'
import TagItem from './pages/TagItem'
import TagContent from './pages/TagContent'
export default {
name: 'TagList',
components: {
TagItem
TagItem,
TagContent
},
methods: {
callback() {
@@ -1,17 +1,397 @@
<!--国内法规新增字段-->
<template>
<div class='domestic-drawer-div'>
<a-drawer
:title='title'
:width="width"
placement="right"
:closable="true"
@close="onClose"
:visible="visible"
:maskClosable='false'
style="height: 100%;overflow: auto;"
>
<div class="new-tag-drawer">
<a-spin :spinning="confirmLoading" style="width: 100%;height:100%">
<a-form-model
:model="form"
:rules="validatorRules"
ref="editForm"
:label-col="labelCol"
:wrapper-col="wrapperCol"
>
<a-row>
{{moduleArr}}
<!--基本信息-->
<p class="tag-info">{{$t('system.tag.essentialInformation')}}</p>
<a-divider dashed/>
<!--所属模块-->
<a-col :span="24" >
<a-form-model-item :label="$t('system.tag.module')" prop="isModel">
<a-select :placeholder="$t('pleaseSelect') + $t('system.tag.module')" disabled v-model="form.isModel">
<a-select-option v-for="item in moduleArr" :key="item.value" :value="item.value" >
{{translate(item.langKey)}}
</a-select-option>
</a-select>
</a-form-model-item>
</a-col>
<!-- 属性名称-->
<a-col :span="24">
<a-form-model-item :label="$t('system.tag.attributeName')" prop="dbFieldTxt">
<a-input v-model="form.dbFieldTxt" :placeholder="$t('pleaseEnter') + $t('system.tag.attributeName')"
:maxLength="120"></a-input>
</a-form-model-item>
</a-col>
<!-- 英文名称-->
<a-col :span="24">
<a-form-model-item :label="$t('system.tag.attributeNameEnglish')" prop="dbFieldEnName">
<a-input v-model="form.dbFieldEnName" :placeholder="$t('pleaseEnter') + $t('system.tag.attributeNameEnglish')"
:maxLength="120"></a-input>
</a-form-model-item>
</a-col>
<!-- 属性类型-->
<a-col :span="24">
<a-form-model-item :label="$t('system.tag.attributeType')" prop="fieldShowType">
<j-dict-select-tag type="list" v-model="form.fieldShowType" dictCode="field_show_type"
:placeholder="$t('pleaseSelect') + $t('system.tag.attributeType')" :disabled="disabledEdit"/>
</a-form-model-item>
</a-col>
<!--选项内容-->
<a-col :span="24" v-if="isTagContent">
<a-form-model-item :label="$t('system.tag.optionContent')" prop="dictId" key="dictId">
<template>
<a-select :placeholder="$t('pleaseSelect') + $t('system.tag.optionContent')" v-model="form.dictId">
<a-select-option v-for="item in contentOption" :key="item.id" :value="item.id">
{{item.dictName}}
</a-select-option>
</a-select>
</template>
</a-form-model-item>
</a-col>
<!--字段长度 key 值必须加解决验证错位的问题-->
<a-col :span="24" v-if="isLength">
<a-form-model-item :label="$t('system.tag.fieldLength')" prop="dbLength" key="dbLength">
<a-input-number v-model="form.dbLength" :min="1" :max="200" :placeholder="$t('pleaseEnter') + $t('system.tag.fieldLength')"
style="width: 100%" :formatter="limitNumber" :parser="limitNumber"/>
</a-form-model-item>
</a-col>
<!--展示顺序-->
<a-col :span="24">
<a-form-model-item :label="$t('system.tag.displayOrder')" prop="orderNum">
<a-input-number v-model="form.orderNum" :placeholder="$t('pleaseEnter') + $t('system.tag.displayOrder')" style="width: 100%"
:min="1" :max="99999" :formatter="limitNumber" :parser="limitNumber"/>
</a-form-model-item>
</a-col>
<!--是否必填-->
<a-col :span="24">
<a-form-model-item :label="$t('system.tag.required')" prop="fieldMustInput">
<j-dict-select-tag type="list" v-model="form.fieldMustInput" dictCode="yn"
:placeholder="$t('pleaseSelect') + $t('system.tag.required')"/>
</a-form-model-item>
</a-col>
<!--文档库模块展示-->
<template>
<p class="tag-info">{{$t('system.tag.documentLibraryModuleDisplay')}}</p>
<a-divider dashed/>
<a-col :span="24">
<a-form-model-item :label="$t('system.tag.documentLibraryListDisplay')" prop="isShowList">
<j-dict-select-tag type="list" v-model="form.isShowList" dictCode="yn"
:placeholder="$t('system.tag.selectWhetherDisplayList')"/>
</a-form-model-item>
</a-col>
<!--展示区域-->
<a-col :span="24">
<a-form-model-item :label="$t('system.tag.showArea')" prop="showArea">
<a-select :placeholder="$t('pleaseSelect') + $t('system.tag.showArea')" v-model="form.showArea">
<a-select-option v-for="(item) in areaOptions" :key="item.id" :value="item.id">
{{item.showArea}}
</a-select-option>
</a-select>
</a-form-model-item>
</a-col>
<!--是否搜索-->
<a-col :span="24" v-if="isSearch">
<a-form-model-item :label="$t('system.tag.search')" prop="isQuery" key="isQuery">
<j-dict-select-tag type="list" v-model="form.isQuery" dictCode="yn"
:placeholder="$t('pleaseSelect') + $t('system.tag.search')"/>
</a-form-model-item>
</a-col>
</template>
<!--其它模块展示-->
<template>
<p class="tag-info">{{$t('system.tag.displayOtherModules')}}</p>
<a-divider dashed/>
<a-col :span="24">
<a-form-model-item :label="$t('system.tag.regulationsListDisplay')" prop="isShowLawsList">
<j-dict-select-tag type="list" v-model="form.isShowLawsList" dictCode="yn"
:placeholder="$t('system.tag.selectDisplayListRegulations')"/>
</a-form-model-item>
</a-col>
<!--搜索中心展示-->
<a-col :span="24">
<a-form-model-item :label="$t('system.tag.searchCenterDisplay')" prop="isShowSearch">
<j-dict-select-tag type="list" v-model="form.isShowSearch" dictCode="yn"
:placeholder="$t('system.tag.selectSearchCenterDisplayed')"/>
</a-form-model-item>
</a-col>
</template>
</a-row>
</a-form-model>
<div class="drawer-footer">
<a-button @click="handleOk" type="primary" style="margin-bottom: 0;">
{{$t('preservation')}}
</a-button>
<a-button @click="handleCancel" style="margin-bottom: 0;">{{$t('close')}}</a-button>
</div>
</a-spin>
</div>
</a-drawer>
</div>
</template>
<script>
import { getShowAreaData, queryDictName } from '../../../../api/api'
import JDictSelectTag from '../../../../components/dict/JDictSelectTag'
import { TagsTypeEnums } from '../../../../enums/commonEnums'
console.log("---TagsTypeEnums.getItemList()------", TagsTypeEnums.getItemList())
export default {
name: 'DomesticDrawer'
name: 'DomesticDrawer',
components: {
JDictSelectTag
},
data () {
return {
visible: false,
title: '',
width: 800,
// 存储表单的数据
form: {},
// form: this.$form.createForm(this),
isEdit: false,
confirmLoading: false,
labelCol: {
xs: { span: 24 },
sm: { span: 6 }
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 }
},
validatorRules: {
// 所属模块
isModel: [
{ required: true, message: this.$t('pleaseSelect') + this.$t('system.tag.module'), trigger: 'change' }
],
// 属性名称
dbFieldTxt: [
{ required: true, message: this.$t('pleaseEnter') + this.$t('system.tag.attributeName'), trigger: 'blur' },
{ min: 1, max: 20, message: this.$t('cantExeed') + '20' + this.$t('characters'), trigger: 'blur' },
{ validator: this.test }
],
dbFieldName: [
{ required: true, message: this.$t('PleaseEnterYourEnglishName'), trigger: 'blur' },
{ min: 1, max: 20, message: this.$t('cantExeed') + '20' + this.$t('characters'), trigger: 'blur' },
{ validator: this.test }
],
// 英文名称
dbFieldEnName: [
{ required: true, message: this.$t('pleaseEnter') + this.$t('system.tag.attributeNameEnglish'), trigger: 'change' },
{ max: 50, message: this.$t('cantExeed') + '50' + this.$t('characters'), trigger: 'blur' },
{ validator: this.test }
],
// 属性类型
fieldShowType: [
{ required: true, message: this.$t('pleaseSelect') + this.$t('system.tag.attributeType'), trigger: 'change' }
],
// 选项内容
dictId: [
{ required: true, message: this.$t('pleaseSelect') + this.$t('system.tag.optionContent'), trigger: 'change' }
],
// 字段长度
dbLength: [
{ required: true, message: this.$t('pleaseEnter') + this.$t('system.tag.fieldLength'), trigger: 'blur' }
],
// 展示顺序
orderNum: [
{ required: true, message: this.$t('pleaseEnter') + this.$t('system.tag.displayOrder'), trigger: 'blur' }
],
// 是否必填
fieldMustInput: [
{ required: true, message: this.$t('pleaseSelect') + this.$t('system.tag.required'), trigger: 'change' }
],
// 文档库模块展示
isShowList: [
{ required: true, message: this.$t('system.tag.selectWhetherDisplayList'), trigger: 'change' }
],
// 展示区域
showArea: [
{ required: true, message: this.$t('pleaseSelect') + this.$t('system.tag.showArea'), trigger: 'change' }
],
// 是否搜索
isQuery: [
{ required: true, message: this.$t('pleaseSelect') + this.$t('system.tag.search'), trigger: 'change' }
],
// 其它模块展示
isShowLawsList: [
{ required: true, message: this.$t('system.tag.selectDisplayListRegulations'), trigger: 'change' }
],
// 搜索中心展示
isShowSearch: [
{ required: true, message: this.$t('system.tag.selectSearchCenterDisplayed'), trigger: 'change' }
]
},
isTagContent: false,
isSearch: true,
isLength: true,
disabledEdit: false,
// 展示区域选项内容
areaOptions: [],
// 选项内容选项
contentOption: [],
contentOption1: [],
contentOption2: [],
moduleArr: TagsTypeEnums.getItemList()
}
},
watch: {
'form.fieldShowType' (val) {
// this.contentFlag=val
if (val == 0) {
this.contentOption = [...this.contentOption2]
this.isTagContent = true
} else if (val == 3 || val == 4) {
this.contentOption = [...this.contentOption1]
this.isTagContent = true
} else {
this.isTagContent = false
}
if (val == 7) {
this.isSearch = false
this.form.isQuery = 0
} else {
this.isSearch = true
}
if (val == 1 || val == 8 || val == 9 || val == 10 || val == 11 || val == 'sel_user') {
this.isLength = true
} else {
this.isLength = false
}
}
},
methods: {
translate(key) {
return this.$t(key)
},
add () {
this.edit({
isModel: 1
})
},
edit (record) {
this.$refs.editForm && this.$refs.editForm.resetFields()
this.form = Object.assign({}, record)
this.isEdit = !!this.form.id
this.initData()
this.visible = true
},
// 初始化一些数据
initData () {
this.getShowAreaData()
this.loadContent()
},
showDrawer () {
this.visible = true
},
onClose () {
this.visible = false
},
handleOk () {
this.$refs.editForm.validate((valid) => {
console.log("---err-----", valid)
if (valid) {
}
})
},
handleCancel () {
this.drawerVisible = false
this.onClose()
},
// 正则替换小数点
limitNumber (value) {
if (typeof value === 'string') {
return !isNaN(Number(value)) ? value.replace(/\./g, '') : 0
} else if (typeof value === 'number') {
return !isNaN(value) ? String(value).replace(/\./g, '') : 0
} else {
return 0
}
},
test (rule, value, callback) {
var money = /[,]|[]/g
if (money.test(value)) {
callback(new Error(this.$t('disableInput') + ','))
} else {
callback()
}
},
// 获取展示区域下拉框数据
getShowAreaData () {
getShowAreaData().then(res => {
if (res.success) {
this.areaOptions = res.result || []
}
})
},
// 获取选项内容
loadContent () {
const params = {}
queryDictName(params).then((res) => {
if (res.success) {
const data = [...res.result]
this.contentOption1 = []
this.contentOption2 = []
data.map(res => {
if (res.attributeType == '1') {
this.contentOption1.push(res)
} else if (res.attributeType == '2') {
this.contentOption2.push(res)
}
})
if (this.form.fieldShowType == 0) {
this.contentOption = [...this.contentOption2]
this.isTagContent = true
} else if (this.form.fieldShowType == 3 || this.form.fieldShowType == '4') {
this.contentOption = [...this.contentOption1]
this.isTagContent = true
} else {
this.isTagContent = false
}
}
})
}
}
}
</script>
<style scoped>
<style scoped lang='less'>
.new-tag-drawer {
.drawer-footer {
height: 32px;
display: flex;
justify-content: center;
.ant-btn {
margin-left: 30px;
margin-bottom: 30px;
float: right;
}
}
}
</style>
@@ -0,0 +1,129 @@
<template>
<j-modal
title="title"
:width="width"
:visible="visible"
switchFullscreen
:maskClosable="false"
:confirmLoading="confirmLoading"
:ok-text="$t('preservation')"
:cancel-text="$t('cancel')"
@ok="handleOk"
@cancel="handleCancel">
<a-spin :spinning="confirmLoading">
<a-form-model ref="form" :model="model" :rules="validatorRules" :label-col="labelCol" :wrapper-col="wrapperCol">
<a-form-model-item :label="$t('LabeItemName')" prop="dictName" class="tag-item">
<a-input
v-model="form.dictName"
:placeholder="$t('PleaseEnterLabelName')"
/>
</a-form-model-item>
<a-form-model-item :label="$t('LabelType')" prop="attributeType" v-if="isEdit==1" class="tag-item">
<j-dict-select-tag type="list" v-model="form.attributeType" dictCode="attribute_type"
:placeholder="$t('PleaseSelectLabelType')"/>
</a-form-model-item>
<a-form-model-item :label="$t('DisplayOrder')" prop="orderNum" class="tag-item">
<a-input-number v-model="form.orderNum" :placeholder="$t('PleaseEnterDisplayOrder')" style="width: 100%"
:min="1" :max="99999" :formatter="limitNumber" :parser="limitNumber"/>
</a-form-model-item>
<a-form-model-item ref="describe" :label="$t('describe')" prop="description" class="tag-item">
<a-input
v-model="form.description"
:placeholder="$t('PleaseEnterDescription')"
/>
</a-form-model-item>
</a-form-model>
</a-spin>
</j-modal>
</template>
<script>
export default {
name: 'TagContentModal',
data () {
return {
title: '新增',
width: 800,
visible: false,
confirmLoading: false,
model: {},
labelCol: {
xs: { span: 24 },
sm: { span: 4 }
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 20 }
},
validatorRules: {
dictName: [
{ required: true, message: this.$t('PleaseEnterLabelName'), trigger: 'change' },
{ min: 1, max: 100, message: this.$t('cantExeed') + '100' + this.$t('characters'), trigger: 'blur' },
{ validator: this.test }
],
attributeType: [
{ required: true, message: this.$t('PleaseSelectLabelType'), trigger: 'blur' }
],
orderNum: [
{ required: true, message: this.$t('PleaseEnterDisplayOrder'), trigger: 'blur' }
],
description: [
{ min: 1, max: 200, message: this.$t('cantExeed') + '200' + this.$t('characters'), trigger: 'blur' }
]
}
}
},
methods: {
add (dictId) {
this.dictId = dictId
// 初始化默认值
this.edit({})
},
edit (record) {
if (record.id) {
this.dictId = record.dictId
}
this.status = record.status
this.visibleCheck = (record.status === 1)
this.model = Object.assign({}, record)
this.model.dictId = this.dictId
this.model.status = this.status
this.visible = true
},
handleOk () {
this.$refs.form.validate(valid => {
if (valid) {
// this.confirmLoading = true
// const formData = Object.assign(this.model, values)
// changePromoter(formData).then(res => {
// if (res.success) {
// this.$message.success(res.message)
// this.$emit('ok')
// this.close()
// } else {
// this.$message.error(res.message)
// }
// }).finally(() => {
// this.confirmLoading = false
// })
}
})
},
// 关闭
handleCancel () {
this.close()
},
close () {
this.$emit('close')
this.visible = false
this.$refs.form && this.$refs.form.resetFields()
}
}
}
</script>
<style scoped>
</style>
@@ -1,47 +1,50 @@
<!-- 国内法规-->
<template>
<div>
<div class='table-page-search-wrapper'>
<a-form layout='inline' @keyup.enter.native='searchQuery'>
<a-row :gutter='24'>
<a-col :md='6' :sm='8'>
<a-form-item :label="$t('system.tag.attributeName')" :labelCol='{span: 5}' :wrapperCol='{span: 18, offset: 1}'>
<j-input :placeholder="$t('pleaseEnter') + $t('system.tag.attributeName')" v-model='queryParam.dbFieldTxt'></j-input>
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="6" :sm="8">
<a-form-item :label="$t('system.tag.attributeName')" :labelCol="{span: 5}"
:wrapperCol="{span: 18, offset: 1}">
<j-input :placeholder="$t('pleaseEnter') + $t('system.tag.attributeName')"
v-model="queryParam.dbFieldTxt"></j-input>
</a-form-item>
</a-col>
<a-col :md='6' :sm='8'>
<a-form-item :label="$t('system.tag.showArea')" :labelCol='{span: 5}' :wrapperCol='{span: 18, offset: 1}'>
<a-select class='box-input' v-model='queryParam.showArea' :placeholder="$t('pleaseSelect') + $t('system.tag.showArea')">
<a-select-option :value='item.id' v-for='item in areasArr' :key='item'>{{ item.showArea }}
<a-col :md="6" :sm="8">
<a-form-item :label="$t('system.tag.showArea')" :labelCol="{span: 5}" :wrapperCol="{span: 18, offset: 1}">
<a-select class="box-input" v-model="queryParam.showArea"
:placeholder="$t('pleaseSelect') + $t('system.tag.showArea')">
<a-select-option :value="item.id" v-for="item in areasArr" :key="item">{{ item.showArea }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<div style='float: right;overflow: hidden;margin-right: 11px' class='table-page-search-submitButtons'>
<a-button class='box-button' @click='searchReset'>{{ $t('reset') }}</a-button>
<a-button class='box-button' style='margin-left: 8px' type='primary' @click='searchQuery'>
<div style="float: right;overflow: hidden;margin-right: 11px" class="table-page-search-submitButtons">
<a-button class="box-button" @click="searchReset">{{ $t('reset') }}</a-button>
<a-button class="box-button" style="margin-left: 8px" type="primary" @click="searchQuery">
{{ $t('query') }}
</a-button>
</div>
</a-row>
</a-form>
</div>
<div class='table-operator'>
<div class='operator-text' @click='handleAdd' >
<a-icon type='plus' />
<div class="table-operator">
<div class="operator-text" @click="handleAdd">
<a-icon type="plus" />
{{ $t('newlyAdded') }}
</div>
<div class='operator-text' @click='handleShow' >
<a-icon type='unordered-list' />
<div class="operator-text" @click="handleShow">
<a-icon type="unordered-list" />
{{ $t('system.tag.exhibitionAreaManagement') }}
</div>
<div class='operator-text' @click='batDelete' >
<a-icon type='delete' />
<div class="operator-text" @click="batchDel">
<a-icon type="delete" />
{{ $t('batchDelete') }}
</div>
</div>
<div >
<div>
<a-table
ref="table"
:bordered="true"
@@ -62,14 +65,16 @@
</a-tooltip>
</template>
<div slot='action' slot-scope='text, record'>
<a class='action-edit' @click='editVisible(record.id)' v-if='record.isReadOnly==0'
>{{ $t('edit') }}</a>
<a class='table-del' v-if='record.isReadOnly==2 ||record.isReadOnly==0' @click='deleteVisible(record.id)'
>{{ $t('delete') }}</a>
<div slot="action" slot-scope="text, record">
<a class="action-edit" @click="editVisible(record.id)" v-if="record.isReadOnly===0"
>{{ $t('edit') }}</a>
<a class="table-del" v-if="record.isReadOnly===2 || record.isReadOnly===0" @click="deleteVisible(record.id)"
>{{ $t('delete') }}</a>
</div>
</a-table>
</div>
<domestic-drawer ref="modalForm"></domestic-drawer>
</div>
</template>
@@ -79,10 +84,15 @@ import { TagListMixin } from './TagListMixin'
import { ResizeColumnProvide, ResizeHeader } from '../../../../mixins/header'
import '@assets/less/common.less'
import DomesticDrawer from '../modules/DomesticDrawer'
export default {
name: 'DomesticList',
mixins: [TagListMixin, ResizeHeader, ResizeColumnProvide],
data () {
components: {
DomesticDrawer
},
data() {
return {
// -
areasArr: [],
@@ -140,7 +150,7 @@ export default {
},
methods: {
//
getShowAreaData () {
getShowAreaData() {
getShowAreaData().then(res => {
if (res.success) {
this.areasArr = res.result || []
@@ -148,7 +158,7 @@ export default {
})
}
},
created () {
created() {
this.getShowAreaData()
}
}
+143
View File
@@ -0,0 +1,143 @@
<template>
<div class="tag-content">
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="6" :sm="8">
<a-form-item :label="$t('system.tag.labelName')" :labelCol="{span: 5}" :wrapperCol="{span: 18, offset: 1}">
<j-input :placeholder="$t('pleaseEnter') + $t('system.tag.labelName')"
v-model="queryParam.dictName"></j-input>
</a-form-item>
</a-col>
<div style="float: right;overflow: hidden;margin-right: 11px" class="table-page-search-submitButtons">
<a-col :md="6" :sm="24">
<a-button class="box-button" @click="searchReset">{{ $t('reset') }}</a-button>
<a-button class="box-button" style="margin-left: 8px" type="primary" @click="searchQuery">
{{ $t('query') }}
</a-button>
</a-col>
</div>
</a-row>
</a-form>
</div>
<div class="table-operator">
<!--v-has="'dict:add'"-->
<div class="operator-text" @click="handleAdd" >
<a-icon type="plus" />
{{ $t('newlyAdded') }}
</div>
<!--v-has="'dict:logicDeleteBatch'"-->
<div class="operator-text" @click="batchDel" >
<a-icon type="delete" />
{{ $t('batchDelete') }}
</div>
</div>
<a-table
class="tag-con-table"
rowKey="id"
:components="drag(columns,'columns')"
:data-source="dataSource"
:pagination="ipagination"
:loading="loading"
:columns="columns"
:scroll="{x: true}"
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
@change="handleTableChange"
>
<template slot="text" slot-scope="text">
<a-tooltip overlay-class-name="tooltip-style">
<template slot="title">{{ text || text === 0 ? text : global.emptyLine }}</template>
<div class="table-text">{{ text || text === 0 ? text : global.emptyLine }}</div>
</a-tooltip>
</template>
<div slot="action" slot-scope="text, record">
<a class="action-dict" @click="editDictItem(record)">{{ $t('system.tag.dictionaryConfiguration') }}</a>
<!--v-if="record.id != '1635543933669818369'" v-has="'dict:edit'"-->
<a class="action-edit" @click="handleEdit(record)">{{ $t('edit') }}</a>
<!--v-if="record.id != '1635543933669818369'" v-has="'dict:logicDelete'"-->
<a class="action-delete" href="javascript:;" @click="handleDelete(record)"
>{{ $t('delete') }}</a>
</div>
</a-table>
<!-- 新增、编辑 -->
<tag-content-modal ref="modalForm"></tag-content-modal>
<!-- 配置属性-->
</div>
</template>
<script>
import '@assets/less/common.less'
import { TagListMixin } from './TagListMixin'
import { ResizeColumnProvide, ResizeHeader } from '../../../../mixins/header'
import TagContentModal from '../modules/TagContentModal'
export default {
name: 'TagContent',
mixins: [TagListMixin, ResizeHeader, ResizeColumnProvide],
components: {
TagContentModal
},
data() {
return {
columns: [
{
title: this.$t('system.tag.labelName'),
dataIndex: 'dictName',
key: 'dictName',
align: 'left',
ellipsis: true,
width: 100,
scopedSlots: { customRender: 'text' }
},
{
title: this.$t('system.tag.labelType'),
align: 'left',
width: 100,
dataIndex: 'attributeTypeName',
scopedSlots: { customRender: 'text' }
},
{
title: this.$t('system.tag.describe'),
align: 'left',
dataIndex: 'description',
ellipsis: true,
width: 300,
scopedSlots: { customRender: 'text' }
},
{
title: this.$t('system.tag.displayOrder'),
align: 'left',
width: 100,
dataIndex: 'orderNum',
scopedSlots: { customRender: 'text' }
},
{
title: this.$t('operation'),
dataIndex: 'action',
scopedSlots: { customRender: 'action' },
align: 'left',
width: 170
}
],
// dataSource: [],
url: {
list: ''
}
}
},
methods: {
// 编辑字典数据
editDictItem(record) {
this.$refs.dictItemList.edit(record)
}
}
}
</script>
<style scoped>
</style>
@@ -2,7 +2,7 @@
<div class='tag-item-container'>
<a-spin :spinning="spinning">
<a-tabs :default-active-key="1" @change="callbackTab">
<a-tab-pane v-for='item in tabArr' :key="item.value" :tab="item.name">
<a-tab-pane v-for='item in tabArr' :key="item.value" :tab="item.showText">
<component :is='item.comp' :type='item.value'></component>
<!--<tag-table v-if="!spinning" :type='item.value'></tag-table>-->
</a-tab-pane>
@@ -12,11 +12,11 @@
</template>
<script>
import TagTable from './modules/TagTable'
import DomesticList from './modules/DomesticList'
import ForeignList from './modules/ForeignList'
import EnterpriseList from './modules/EnterpriseList'
import ClauseSplittingList from './modules/ClauseSplittingList'
import TagTable from '../modules/TagTable'
import DomesticList from './DomesticList'
import ForeignList from './ForeignList'
import EnterpriseList from './EnterpriseList'
import ClauseSplittingList from './ClauseSplittingList'
export default {
name: 'TagItem',
@@ -31,10 +31,10 @@ export default {
return {
spinning: false,
tabArr: [
{ name: '国内法规', value: 1, comp: DomesticList, props: {} },
{ name: '海外标准', value: 2, comp: ForeignList },
{ name: '企业标准', value: 3, comp: EnterpriseList },
{ name: '条款拆分', value: 4, comp: ClauseSplittingList }
{ name: '国内法规', showText: this.$t('system.tag.domesticLaws'), value: 1, comp: DomesticList, props: {} },
{ name: '海外标准', showText: this.$t('system.tag.foreignStandards'), value: 2, comp: ForeignList },
{ name: '企业标准', showText: this.$t('system.tag.enterpriseStandards'), value: 3, comp: EnterpriseList },
{ name: '条款拆分', showText: this.$t('system.tag.clauseSplitting'), value: 4, comp: ClauseSplittingList }
]
}
},
@@ -142,39 +142,41 @@ export const TagListMixin = {
this.queryParam = {}
this.loadData(1)
},
batchDel: function () {
batchDel () {
console.log("------batchDel-----")
if (!this.url.deleteBatch) {
this.$message.error('请设置url.deleteBatch属性!')
return
}
if (this.selectedRowKeys.length <= 0) {
this.$message.warning('请选择一条记录!')
} else {
let ids = ''
for (let a = 0; a < this.selectedRowKeys.length; a++) {
ids += this.selectedRowKeys[a] + ','
}
const that = this
this.$confirm({
title: '确认删除',
content: '是否删除选中数据?',
onOk: function () {
that.loading = true
postAction(that.url.deleteBatch, { ids: ids }).then((res) => {
if (res.success) {
// 重新计算分页问题
that.reCalculatePage(that.selectedRowKeys.length)
that.$message.success(res.message)
that.loadData()
that.onClearSelected()
} else {
that.$message.warning(res.message)
}
}).finally(() => {
that.loading = false
})
}
})
return
}
let ids = ''
for (let a = 0; a < this.selectedRowKeys.length; a++) {
ids += this.selectedRowKeys[a] + ','
}
const that = this
this.$confirm({
title: '确认删除',
content: '是否删除选中数据?',
onOk: function () {
that.loading = true
postAction(that.url.deleteBatch, { ids: ids }).then((res) => {
if (res.success) {
// 重新计算分页问题
that.reCalculatePage(that.selectedRowKeys.length)
that.$message.success(res.message)
that.loadData()
that.onClearSelected()
} else {
that.$message.warning(res.message)
}
}).finally(() => {
that.loading = false
})
}
})
},
handleDelete: function (id) {
if (!this.url.delete) {