【update】标签管理+数据字典-一些细节的处理
This commit is contained in:
@@ -18,7 +18,9 @@ export const FieldType = {
|
|||||||
FILE_UP: { text: '上传文件', value: '8' },
|
FILE_UP: { text: '上传文件', value: '8' },
|
||||||
TEXT_BOX: { text: '文本框', value: '9' },
|
TEXT_BOX: { text: '文本框', value: '9' },
|
||||||
OPTION_SINGLE: { text: '下拉单选', value: '10' },
|
OPTION_SINGLE: { text: '下拉单选', value: '10' },
|
||||||
OPTION_MORE: { text: '下拉多选', value: '11' }
|
OPTION_MORE: { text: '下拉多选', value: '11' },
|
||||||
|
TREE: { text: '树形结构', value: '12' },
|
||||||
|
TEXT_LINK: { text: '输入框(链接)', value: '13' }
|
||||||
}
|
}
|
||||||
|
|
||||||
export const TagsTypeEnums = new EsEnums({
|
export const TagsTypeEnums = new EsEnums({
|
||||||
|
|||||||
@@ -133,12 +133,18 @@ export default {
|
|||||||
this.model.description = (this.model.description || '').trim()
|
this.model.description = (this.model.description || '').trim()
|
||||||
this.model.status = this.status
|
this.model.status = this.status
|
||||||
let obj
|
let obj
|
||||||
|
// 数据字典
|
||||||
if (!this.model.id) {
|
if (!this.model.id) {
|
||||||
obj = addDictItem(this.model)
|
obj = addDictItem
|
||||||
} else {
|
} else {
|
||||||
obj = editDictItem(this.model)
|
obj = editDictItem
|
||||||
}
|
}
|
||||||
obj.then((res) => {
|
const params = Object.assign({}, this.model, {
|
||||||
|
dictId: this.dictId, // 数据字典的id
|
||||||
|
isTagDict: 0, // 是否为标签管理的表示
|
||||||
|
delFlag: 0 // 是否删除的标识,新的接口必须增加这一个字段,可以联系后端沟通,否则不能查看
|
||||||
|
})
|
||||||
|
obj(params).then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
that.$message.success(res.message)
|
that.$message.success(res.message)
|
||||||
that.$emit('ok')
|
that.$emit('ok')
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ export default {
|
|||||||
{ min: 1, max: 50, message: this.$t('charactersLength'), trigger: 'blur' }
|
{ min: 1, max: 50, message: this.$t('charactersLength'), trigger: 'blur' }
|
||||||
],
|
],
|
||||||
sort: [
|
sort: [
|
||||||
{ required: true, message: this.$t('enterSortingNumber'), trigger: 'change' }
|
{ required: false, message: this.$t('enterSortingNumber'), trigger: 'change' }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
moduleArr: TagsTypeEnums.getItemList()
|
moduleArr: TagsTypeEnums.getItemList()
|
||||||
|
|||||||
@@ -18,11 +18,16 @@
|
|||||||
<a-icon type="plus" />
|
<a-icon type="plus" />
|
||||||
{{$t('add')}}
|
{{$t('add')}}
|
||||||
</div>
|
</div>
|
||||||
|
<div class="operator-text" @click="batchDel">
|
||||||
|
<a-icon type="delete" />
|
||||||
|
{{ $t('batchDelete') }}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<a-table
|
<j-table
|
||||||
ref="table"
|
ref="table"
|
||||||
:bordered="true"
|
bordered
|
||||||
|
can-drag
|
||||||
size="middle"
|
size="middle"
|
||||||
rowKey="id"
|
rowKey="id"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
@@ -32,20 +37,13 @@
|
|||||||
:scroll="{x: '100%'}"
|
:scroll="{x: '100%'}"
|
||||||
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
|
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
|
||||||
@change="handleTableChange">
|
@change="handleTableChange">
|
||||||
<template slot="text" slot-scope="text">
|
<div slot="action" class="table-action" slot-scope="{text, record}">
|
||||||
<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" class="table-action" slot-scope="text, record">
|
|
||||||
<a class="action-edit" @click="handleEdit(record)" v-has="'area:edit'"
|
<a class="action-edit" @click="handleEdit(record)" v-has="'area:edit'"
|
||||||
>{{ $t('edit') }}</a>
|
>{{ $t('edit') }}</a>
|
||||||
<a class="table-del" @click="handleDelete(record.id)" v-has="'area:delete'"
|
<a class="table-del" @click="handleDelete(record.id)" v-has="'area:delete'"
|
||||||
>{{ $t('delete') }}</a>
|
>{{ $t('delete') }}</a>
|
||||||
</div>
|
</div>
|
||||||
</a-table>
|
</j-table>
|
||||||
</a-spin>
|
</a-spin>
|
||||||
<!--新增表单-->
|
<!--新增表单-->
|
||||||
<area-form-modal v-bind="$props" ref="modalForm" @ok="modalFormOk"></area-form-modal>
|
<area-form-modal v-bind="$props" ref="modalForm" @ok="modalFormOk"></area-form-modal>
|
||||||
@@ -58,6 +56,7 @@ import AreaFormModal from './AreaFormModal'
|
|||||||
import { TagsTypeEnums } from '../../../../enums/commonEnums'
|
import { TagsTypeEnums } from '../../../../enums/commonEnums'
|
||||||
import { SimpleListMixin } from '../../../../mixins/SimpleListMixin'
|
import { SimpleListMixin } from '../../../../mixins/SimpleListMixin'
|
||||||
import { postAction } from '../../../../api/manage'
|
import { postAction } from '../../../../api/manage'
|
||||||
|
import JTable from '../../../../components/jero/JTable'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'AreaModal',
|
name: 'AreaModal',
|
||||||
@@ -71,7 +70,8 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
AreaFormModal
|
AreaFormModal,
|
||||||
|
JTable
|
||||||
},
|
},
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
@@ -104,13 +104,13 @@ export default {
|
|||||||
dataIndex: 'enName',
|
dataIndex: 'enName',
|
||||||
ellipsis: true
|
ellipsis: true
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
title: this.$t('system.tag.module'),
|
// title: this.$t('system.tag.module'),
|
||||||
align: 'left',
|
// align: 'left',
|
||||||
width: 100,
|
// width: 100,
|
||||||
dataIndex: 'isModelName',
|
// dataIndex: 'isModelName',
|
||||||
ellipsis: true
|
// ellipsis: true
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
title: this.$t('dict.rankingValue'),
|
title: this.$t('dict.rankingValue'),
|
||||||
align: 'left',
|
align: 'left',
|
||||||
@@ -155,6 +155,8 @@ export default {
|
|||||||
modalFormOk () {
|
modalFormOk () {
|
||||||
this.$emit('refresh')
|
this.$emit('refresh')
|
||||||
this.loadData()
|
this.loadData()
|
||||||
|
// 清空列表选中
|
||||||
|
this.onClearSelected()
|
||||||
},
|
},
|
||||||
handleDelete: function (id) {
|
handleDelete: function (id) {
|
||||||
if (!this.url.delete) {
|
if (!this.url.delete) {
|
||||||
@@ -173,6 +175,7 @@ export default {
|
|||||||
if (that.ipagination.current > 1 && ((that.ipagination.current - 1) * that.ipagination.pageSize) + 1 === that.ipagination.total) {
|
if (that.ipagination.current > 1 && ((that.ipagination.current - 1) * that.ipagination.pageSize) + 1 === that.ipagination.total) {
|
||||||
that.ipagination.current -= 1
|
that.ipagination.current -= 1
|
||||||
}
|
}
|
||||||
|
// 增加列表页的操作
|
||||||
that.$emit('refresh')
|
that.$emit('refresh')
|
||||||
that.loadData()
|
that.loadData()
|
||||||
} else {
|
} else {
|
||||||
@@ -182,6 +185,41 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
batchDel () {
|
||||||
|
if (!this.url.deleteBatch) {
|
||||||
|
this.$message.error('请设置url.deleteBatch属性!')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (this.selectedRowKeys.length <= 0) {
|
||||||
|
this.$message.warning('请选择一条记录!')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const ids = this.selectedRowKeys.join()
|
||||||
|
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()
|
||||||
|
// 增加列表页的操作
|
||||||
|
that.$emit('refresh')
|
||||||
|
} else {
|
||||||
|
that.$message.warning(res.message)
|
||||||
|
}
|
||||||
|
}).finally(() => {
|
||||||
|
that.loading = false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -115,8 +115,8 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import JDictSelectTag from '../../../../components/dict/JDictSelectTag'
|
import JDictSelectTag from '../../../../components/dict/JDictSelectTag'
|
||||||
import { TagsTypeEnums } from '../../../../enums/commonEnums'
|
import { FieldType, TagsAttributeTypeEnums, TagsTypeEnums } from '../../../../enums/commonEnums'
|
||||||
import { queryDictName } from '../../../../api/api'
|
import { addTag, editTag, queryDictName } from '../../../../api/api'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ClauseSplittingDrawer',
|
name: 'ClauseSplittingDrawer',
|
||||||
@@ -211,34 +211,14 @@ export default {
|
|||||||
areaOptions: [],
|
areaOptions: [],
|
||||||
// 选项内容选项
|
// 选项内容选项
|
||||||
contentOption: [],
|
contentOption: [],
|
||||||
contentOption1: [],
|
contentOptionSelect: [],
|
||||||
contentOption2: [],
|
contentOptionTree: [],
|
||||||
moduleArr: TagsTypeEnums.getItemList()
|
moduleArr: TagsTypeEnums.getItemList()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
'form.fieldShowType' (val) {
|
'form.fieldShowType' (val) {
|
||||||
// this.contentFlag=val
|
this.initFlags(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: {
|
methods: {
|
||||||
@@ -271,6 +251,23 @@ export default {
|
|||||||
this.$refs.editForm.validate((valid) => {
|
this.$refs.editForm.validate((valid) => {
|
||||||
console.log('---err-----', valid)
|
console.log('---err-----', valid)
|
||||||
if (valid) {
|
if (valid) {
|
||||||
|
this.confirmLoading = true
|
||||||
|
const formData = Object.assign({}, this.form)
|
||||||
|
let Func = addTag
|
||||||
|
if (this.isEdit) {
|
||||||
|
Func = editTag
|
||||||
|
}
|
||||||
|
Func(formData).then(res => {
|
||||||
|
if (res.success) {
|
||||||
|
this.$message.success(res.message)
|
||||||
|
this.$emit('ok')
|
||||||
|
this.onClose()
|
||||||
|
} else {
|
||||||
|
this.$message.error(res.message)
|
||||||
|
}
|
||||||
|
}).finally(() => {
|
||||||
|
this.confirmLoading = false
|
||||||
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -296,26 +293,59 @@ export default {
|
|||||||
callback()
|
callback()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
// 初始化所有判断的值
|
||||||
|
// 具体值对应关系可以去commonEnums.js中查看 FieldType
|
||||||
|
initFlags (val) {
|
||||||
|
val = val + ''
|
||||||
|
// this.contentFlag=val
|
||||||
|
// 树形结构
|
||||||
|
if (val === FieldType.TREE.value) {
|
||||||
|
this.contentOption = [...this.contentOptionTree]
|
||||||
|
this.isTagContent = true
|
||||||
|
} else if (val === FieldType.OPTION_SINGLE.value || val === FieldType.OPTION_MORE.value) {
|
||||||
|
// 下拉单选 下拉多选
|
||||||
|
this.contentOption = [...this.contentOptionSelect]
|
||||||
|
this.isTagContent = true
|
||||||
|
} else {
|
||||||
|
this.isTagContent = false
|
||||||
|
}
|
||||||
|
// 上传文件
|
||||||
|
if (val === FieldType.FILE_UP.value) {
|
||||||
|
this.isSearch = false
|
||||||
|
this.form.isQuery = 0
|
||||||
|
} else {
|
||||||
|
this.isSearch = true
|
||||||
|
}
|
||||||
|
// 输入框(字符串) 文本框 人员选择 标准选择 输入框(链接)
|
||||||
|
if (val === FieldType.TEXT_LINK.value || val === FieldType.TEXT_BOX.value || val === FieldType.USER_SINGLE.value || val === FieldType.STANDARD_MORE.value || val === FieldType.TEXT_LINK.value || val === 'sel_user') {
|
||||||
|
this.isLength = true
|
||||||
|
} else {
|
||||||
|
this.isLength = false
|
||||||
|
}
|
||||||
|
},
|
||||||
// 获取选项内容
|
// 获取选项内容
|
||||||
loadContent () {
|
loadContent () {
|
||||||
const params = {}
|
const params = {}
|
||||||
queryDictName(params).then((res) => {
|
queryDictName(params).then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
const data = [...res.result]
|
const data = [...res.result]
|
||||||
this.contentOption1 = []
|
this.contentOptionSelect = []
|
||||||
this.contentOption2 = []
|
this.contentOptionTree = []
|
||||||
data.map(res => {
|
data.map(res => {
|
||||||
if (res.attributeType == '1') {
|
const num = Number(res.attributeType)
|
||||||
this.contentOption1.push(res)
|
if (num === TagsAttributeTypeEnums.SELECT.value) {
|
||||||
} else if (res.attributeType == '2') {
|
this.contentOptionSelect.push(res)
|
||||||
this.contentOption2.push(res)
|
} else if (num === TagsAttributeTypeEnums.TREE.value) {
|
||||||
|
this.contentOptionTree.push(res)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
if (this.form.fieldShowType == 0) {
|
// 树形结构
|
||||||
this.contentOption = [...this.contentOption2]
|
if (this.form.fieldShowType === FieldType.TREE.value) {
|
||||||
|
this.contentOption = [...this.contentOptionTree]
|
||||||
this.isTagContent = true
|
this.isTagContent = true
|
||||||
} else if (this.form.fieldShowType == 3 || this.form.fieldShowType == '4') {
|
} else if (this.form.fieldShowType === FieldType.OPTION_SINGLE.value || this.form.fieldShowType === FieldType.OPTION_MORE.value) {
|
||||||
this.contentOption = [...this.contentOption1]
|
// 下拉单选 下拉多选
|
||||||
|
this.contentOption = [...this.contentOptionSelect]
|
||||||
this.isTagContent = true
|
this.isTagContent = true
|
||||||
} else {
|
} else {
|
||||||
this.isTagContent = false
|
this.isTagContent = false
|
||||||
|
|||||||
@@ -178,7 +178,7 @@
|
|||||||
|
|
||||||
import { addTag, editTag, getShowAreaData, queryDictName } from '../../../../api/api'
|
import { addTag, editTag, getShowAreaData, queryDictName } from '../../../../api/api'
|
||||||
import JDictSelectTag from '../../../../components/dict/JDictSelectTag'
|
import JDictSelectTag from '../../../../components/dict/JDictSelectTag'
|
||||||
import { TagsTypeEnums } from '../../../../enums/commonEnums'
|
import { FieldType, TagsAttributeTypeEnums, TagsTypeEnums } from '../../../../enums/commonEnums'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'StandardDrawer',
|
name: 'StandardDrawer',
|
||||||
@@ -293,36 +293,14 @@ export default {
|
|||||||
areaOptions: [],
|
areaOptions: [],
|
||||||
// 选项内容选项
|
// 选项内容选项
|
||||||
contentOption: [],
|
contentOption: [],
|
||||||
contentOption1: [],
|
contentOptionSelect: [],
|
||||||
contentOption2: [],
|
contentOptionTree: [],
|
||||||
moduleArr: TagsTypeEnums.getItemList()
|
moduleArr: TagsTypeEnums.getItemList()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
// 具体值对应关系可以去commonEnums.js中查看 FieldType
|
|
||||||
'form.fieldShowType' (val) {
|
'form.fieldShowType' (val) {
|
||||||
val = val + ''
|
this.initFlags(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: {
|
methods: {
|
||||||
@@ -344,7 +322,7 @@ export default {
|
|||||||
this.visible = true
|
this.visible = true
|
||||||
},
|
},
|
||||||
// 初始化一些数据
|
// 初始化一些数据
|
||||||
initData () {
|
async initData () {
|
||||||
this.getShowAreaData()
|
this.getShowAreaData()
|
||||||
this.loadContent()
|
this.loadContent()
|
||||||
},
|
},
|
||||||
@@ -408,26 +386,59 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
// 初始化所有判断的值
|
||||||
|
// 具体值对应关系可以去commonEnums.js中查看 FieldType
|
||||||
|
initFlags (val) {
|
||||||
|
val = val + ''
|
||||||
|
// this.contentFlag=val
|
||||||
|
// 树形结构
|
||||||
|
if (val === FieldType.TREE.value) {
|
||||||
|
this.contentOption = [...this.contentOptionTree]
|
||||||
|
this.isTagContent = true
|
||||||
|
} else if (val === FieldType.OPTION_SINGLE.value || val === FieldType.OPTION_MORE.value) {
|
||||||
|
// 下拉单选 下拉多选
|
||||||
|
this.contentOption = [...this.contentOptionSelect]
|
||||||
|
this.isTagContent = true
|
||||||
|
} else {
|
||||||
|
this.isTagContent = false
|
||||||
|
}
|
||||||
|
// 上传文件
|
||||||
|
if (val === FieldType.FILE_UP.value) {
|
||||||
|
this.isSearch = false
|
||||||
|
this.form.isQuery = 0
|
||||||
|
} else {
|
||||||
|
this.isSearch = true
|
||||||
|
}
|
||||||
|
// 输入框(字符串) 文本框 人员选择 标准选择 输入框(链接)
|
||||||
|
if (val === FieldType.TEXT_LINK.value || val === FieldType.TEXT_BOX.value || val === FieldType.USER_SINGLE.value || val === FieldType.STANDARD_MORE.value || val === FieldType.TEXT_LINK.value || val === 'sel_user') {
|
||||||
|
this.isLength = true
|
||||||
|
} else {
|
||||||
|
this.isLength = false
|
||||||
|
}
|
||||||
|
},
|
||||||
// 获取选项内容
|
// 获取选项内容
|
||||||
loadContent () {
|
loadContent () {
|
||||||
const params = {}
|
const params = {}
|
||||||
queryDictName(params).then((res) => {
|
queryDictName(params).then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
const data = [...res.result]
|
const data = [...res.result]
|
||||||
this.contentOption1 = []
|
this.contentOptionSelect = []
|
||||||
this.contentOption2 = []
|
this.contentOptionTree = []
|
||||||
data.map(res => {
|
data.map(res => {
|
||||||
if (res.attributeType == '1') {
|
const num = Number(res.attributeType)
|
||||||
this.contentOption1.push(res)
|
if (num === TagsAttributeTypeEnums.SELECT.value) {
|
||||||
} else if (res.attributeType == '2') {
|
this.contentOptionSelect.push(res)
|
||||||
this.contentOption2.push(res)
|
} else if (num === TagsAttributeTypeEnums.TREE.value) {
|
||||||
|
this.contentOptionTree.push(res)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
if (this.form.fieldShowType == 0) {
|
// 树形结构
|
||||||
this.contentOption = [...this.contentOption2]
|
if (this.form.fieldShowType === FieldType.TREE.value) {
|
||||||
|
this.contentOption = [...this.contentOptionTree]
|
||||||
this.isTagContent = true
|
this.isTagContent = true
|
||||||
} else if (this.form.fieldShowType == 3 || this.form.fieldShowType == '4') {
|
} else if (this.form.fieldShowType === FieldType.OPTION_SINGLE.value || this.form.fieldShowType === FieldType.OPTION_MORE.value) {
|
||||||
this.contentOption = [...this.contentOption1]
|
// 下拉单选 下拉多选
|
||||||
|
this.contentOption = [...this.contentOptionSelect]
|
||||||
this.isTagContent = true
|
this.isTagContent = true
|
||||||
} else {
|
} else {
|
||||||
this.isTagContent = false
|
this.isTagContent = false
|
||||||
|
|||||||
@@ -110,11 +110,7 @@ export default {
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
// 父级项目下拉框数据的集合
|
// 父级项目下拉框数据的集合
|
||||||
parentDataPid: [],
|
parentDataPid: []
|
||||||
treeFunc: {
|
|
||||||
add: 'sys/category/add',
|
|
||||||
edit: 'sys/category/edit',
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -126,6 +122,10 @@ export default {
|
|||||||
edit (record) {
|
edit (record) {
|
||||||
if (record.id) {
|
if (record.id) {
|
||||||
this.dictId = record.dictId
|
this.dictId = record.dictId
|
||||||
|
// 一级菜单则将父级的默认值0 删除
|
||||||
|
if (record.parentId === '0') {
|
||||||
|
record.parentId = undefined
|
||||||
|
}
|
||||||
}
|
}
|
||||||
this.status = record.status
|
this.status = record.status
|
||||||
this.visibleCheck = (record.status === 1)
|
this.visibleCheck = (record.status === 1)
|
||||||
|
|||||||
@@ -31,11 +31,11 @@
|
|||||||
</a-form>
|
</a-form>
|
||||||
</div>
|
</div>
|
||||||
<div class="table-operator">
|
<div class="table-operator">
|
||||||
<div class="operator-text" @click="handleAdd">
|
<div class="operator-text" @click="handleAdd" v-has="'sys:dict:operation'">
|
||||||
<a-icon type="plus" />
|
<a-icon type="plus" />
|
||||||
{{ $t('newlyAdded') }}
|
{{ $t('newlyAdded') }}
|
||||||
</div>
|
</div>
|
||||||
<div class="operator-text" @click="batchDel">
|
<div class="operator-text" @click="batchDel" v-has="'sys:dict:operation'">
|
||||||
<a-icon type="delete" />
|
<a-icon type="delete" />
|
||||||
{{ $t('batchDelete') }}
|
{{ $t('batchDelete') }}
|
||||||
</div>
|
</div>
|
||||||
@@ -56,8 +56,8 @@
|
|||||||
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
|
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
|
||||||
@change="handleTableChange">
|
@change="handleTableChange">
|
||||||
<div slot="action" class="table-action" slot-scope="{text, record}">
|
<div slot="action" class="table-action" slot-scope="{text, record}">
|
||||||
<a class="action-edit" @click="handleEdit(record)">{{ $t('edit') }}</a>
|
<a class="action-edit" @click="handleEdit(record)" v-has="'sys:dict:operation'">{{ $t('edit') }}</a>
|
||||||
<a class="table-del" @click="handleDelete(record.id)">{{ $t('delete') }}</a>
|
<a class="table-del" @click="handleDelete(record.id)" v-has="'sys:dict:operation'">{{ $t('delete') }}</a>
|
||||||
</div>
|
</div>
|
||||||
</j-table>
|
</j-table>
|
||||||
</div>
|
</div>
|
||||||
@@ -144,6 +144,11 @@ export default {
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
columns: [],
|
columns: [],
|
||||||
|
/* 排序参数--按照排序字段失序 */
|
||||||
|
isorter: {
|
||||||
|
column: 'sortOrder',
|
||||||
|
order: 'ascend'
|
||||||
|
},
|
||||||
// 树形结构对应的接口
|
// 树形结构对应的接口
|
||||||
treeUrl: {
|
treeUrl: {
|
||||||
list: 'sys/dictItem/treeList',
|
list: 'sys/dictItem/treeList',
|
||||||
|
|||||||
@@ -26,6 +26,15 @@
|
|||||||
<j-dict-select-tag type="list" v-model="model.attributeType" dictCode="attribute_type"
|
<j-dict-select-tag type="list" v-model="model.attributeType" dictCode="attribute_type"
|
||||||
:placeholder="$t('pleaseSelect') + $t('system.tag.labelType')"/>
|
:placeholder="$t('pleaseSelect') + $t('system.tag.labelType')"/>
|
||||||
</a-form-model-item>
|
</a-form-model-item>
|
||||||
|
<!--字典编码 ---是因为后端会报错增加的,但是需求设计中没有这个字段 -->
|
||||||
|
<a-form-model-item prop="dictCode" :label="$t('dict.dictionaryNumber')">
|
||||||
|
<a-input
|
||||||
|
:maxLength="50"
|
||||||
|
:placeholder="$t('pleaseEnter') + $t('dict.dictionaryNumber')"
|
||||||
|
v-model="model.dictCode"
|
||||||
|
@change="event => event.target.value = event.target.value.trim()"
|
||||||
|
/>
|
||||||
|
</a-form-model-item>
|
||||||
<!--展示顺序-->
|
<!--展示顺序-->
|
||||||
<a-form-model-item :label="$t('system.tag.displayOrder')" prop="orderNum" class="tag-item">
|
<a-form-model-item :label="$t('system.tag.displayOrder')" prop="orderNum" class="tag-item">
|
||||||
<a-input-number v-model="model.orderNum" :placeholder="$t('pleaseEnter') + $t('system.tag.displayOrder')" style="width: 100%"
|
<a-input-number v-model="model.orderNum" :placeholder="$t('pleaseEnter') + $t('system.tag.displayOrder')" style="width: 100%"
|
||||||
@@ -49,7 +58,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import JDictSelectTag from '../../../../components/dict/JDictSelectTag'
|
import JDictSelectTag from '../../../../components/dict/JDictSelectTag'
|
||||||
import { addDict, editDict } from '../../../../api/api'
|
import { addDict, duplicateCheck, editDict } from '../../../../api/api'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'TagContentModal',
|
name: 'TagContentModal',
|
||||||
@@ -80,6 +89,10 @@ export default {
|
|||||||
attributeType: [
|
attributeType: [
|
||||||
{ required: true, message: this.$t('pleaseSelect') + this.$t('system.tag.labelType'), trigger: 'blur' }
|
{ required: true, message: this.$t('pleaseSelect') + this.$t('system.tag.labelType'), trigger: 'blur' }
|
||||||
],
|
],
|
||||||
|
// 字典编码
|
||||||
|
dictCode: [
|
||||||
|
{ required: true, message: this.$t('pleaseEnter') + this.$t('dict.dictionaryNumber') },
|
||||||
|
{ validator: this.validateDictCode }],
|
||||||
// 展示顺序
|
// 展示顺序
|
||||||
orderNum: [
|
orderNum: [
|
||||||
{ required: true, message: this.$t('pleaseEnter') + this.$t('system.tag.displayOrder'), trigger: 'blur' }
|
{ required: true, message: this.$t('pleaseEnter') + this.$t('system.tag.displayOrder'), trigger: 'blur' }
|
||||||
@@ -152,6 +165,22 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
validateDictCode (rule, value, callback) {
|
||||||
|
// 重复校验
|
||||||
|
const params = {
|
||||||
|
tableName: 'sys_dict',
|
||||||
|
fieldName: 'dict_code',
|
||||||
|
fieldVal: value,
|
||||||
|
dataId: this.model.id
|
||||||
|
}
|
||||||
|
duplicateCheck(params).then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
callback()
|
||||||
|
} else {
|
||||||
|
callback(res.message)
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<div class="table-page-search-wrapper">
|
<div class="table-page-search-wrapper">
|
||||||
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
||||||
<a-row :gutter="24">
|
<a-row :gutter="24">
|
||||||
<a-col :md="6" :sm="8">
|
<a-col :span="8">
|
||||||
<a-form-item :label="$t('system.tag.attributeName')" :labelCol="{span: 5}"
|
<a-form-item :label="$t('system.tag.attributeName')" :labelCol="{span: 5}"
|
||||||
:wrapperCol="{span: 18, offset: 1}">
|
:wrapperCol="{span: 18, offset: 1}">
|
||||||
<j-input :placeholder="$t('pleaseEnter') + $t('system.tag.attributeName')"
|
<j-input :placeholder="$t('pleaseEnter') + $t('system.tag.attributeName')"
|
||||||
|
|||||||
@@ -4,14 +4,14 @@
|
|||||||
<div class="table-page-search-wrapper">
|
<div class="table-page-search-wrapper">
|
||||||
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
||||||
<a-row :gutter="24">
|
<a-row :gutter="24">
|
||||||
<a-col :md="6" :sm="8">
|
<a-col :span="8">
|
||||||
<a-form-item :label="$t('system.tag.attributeName')" :labelCol="{span: 5}"
|
<a-form-item :label="$t('system.tag.attributeName')" :labelCol="{span: 5}"
|
||||||
:wrapperCol="{span: 18, offset: 1}">
|
:wrapperCol="{span: 18, offset: 1}">
|
||||||
<j-input :placeholder="$t('pleaseEnter') + $t('system.tag.attributeName')"
|
<j-input :placeholder="$t('pleaseEnter') + $t('system.tag.attributeName')"
|
||||||
v-model="queryParam.dbFieldTxt"></j-input>
|
v-model="queryParam.dbFieldTxt"></j-input>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :md="6" :sm="8">
|
<a-col :span="8">
|
||||||
<a-form-item :label="$t('system.tag.showArea')" :labelCol="{span: 5}" :wrapperCol="{span: 18, offset: 1}">
|
<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"
|
<a-select class="box-input" v-model="queryParam.showArea"
|
||||||
:placeholder="$t('pleaseSelect') + $t('system.tag.showArea')">
|
:placeholder="$t('pleaseSelect') + $t('system.tag.showArea')">
|
||||||
@@ -149,6 +149,7 @@ export default {
|
|||||||
title: this.$t('operation'),
|
title: this.$t('operation'),
|
||||||
scopedSlots: { customRender: 'action' },
|
scopedSlots: { customRender: 'action' },
|
||||||
align: 'center',
|
align: 'center',
|
||||||
|
fixed: 'right',
|
||||||
width: 150
|
width: 150
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -3,20 +3,20 @@
|
|||||||
<div class="table-page-search-wrapper">
|
<div class="table-page-search-wrapper">
|
||||||
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
||||||
<a-row :gutter="24">
|
<a-row :gutter="24">
|
||||||
<a-col :md="6" :sm="8">
|
<a-col :span="8">
|
||||||
<a-form-item :label="$t('system.tag.labelName')" :labelCol="{span: 5}" :wrapperCol="{span: 18, offset: 1}">
|
<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')"
|
<j-input :placeholder="$t('pleaseEnter') + $t('system.tag.labelName')"
|
||||||
v-model="queryParam.dictName"></j-input>
|
v-model="queryParam.dictName"></j-input>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :md="6" :sm="8">
|
<a-col :span="8">
|
||||||
<a-form-item :label="$t('system.tag.labelType')" :labelCol="{span: 5}" :wrapperCol="{span: 18, offset: 1}">
|
<a-form-item :label="$t('system.tag.labelType')" :labelCol="{span: 5}" :wrapperCol="{span: 18, offset: 1}">
|
||||||
<j-dict-select-tag type="list" v-model="queryParam.attributeType" dictCode="attribute_type"
|
<j-dict-select-tag type="list" v-model="queryParam.attributeType" dictCode="attribute_type"
|
||||||
:placeholder="$t('pleaseSelect') + $t('system.tag.labelType')" />
|
:placeholder="$t('pleaseSelect') + $t('system.tag.labelType')" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<div style="float: right;overflow: hidden;margin-right: 11px" class="table-page-search-submitButtons">
|
<div style="float: right;overflow: hidden;margin-right: 11px" class="table-page-search-submitButtons">
|
||||||
<a-col :md="6" :sm="24">
|
<a-col :span="8">
|
||||||
<a-button class="box-button" @click="searchReset">{{ $t('reset') }}</a-button>
|
<a-button class="box-button" @click="searchReset">{{ $t('reset') }}</a-button>
|
||||||
<a-button class="box-button" style="margin-left: 8px" type="primary" @click="searchQuery">
|
<a-button class="box-button" style="margin-left: 8px" type="primary" @click="searchQuery">
|
||||||
{{ $t('query') }}
|
{{ $t('query') }}
|
||||||
@@ -28,12 +28,12 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="table-operator">
|
<div class="table-operator">
|
||||||
<!--v-has="'dict:add'"-->
|
<!--v-has="'dict:add'"-->
|
||||||
<div class="operator-text" @click="handleAdd">
|
<div class="operator-text" @click="handleAdd" v-has="'sys:dict:operation'">
|
||||||
<a-icon type="plus" />
|
<a-icon type="plus" />
|
||||||
{{ $t('newlyAdded') }}
|
{{ $t('newlyAdded') }}
|
||||||
</div>
|
</div>
|
||||||
<!--v-has="'dict:logicDeleteBatch'"-->
|
<!--v-has="'dict:logicDeleteBatch'"-->
|
||||||
<div class="operator-text" @click="batchDel">
|
<div class="operator-text" @click="batchDel" v-has="'sys:dict:operation'">
|
||||||
<a-icon type="delete" />
|
<a-icon type="delete" />
|
||||||
{{ $t('batchDelete') }}
|
{{ $t('batchDelete') }}
|
||||||
</div>
|
</div>
|
||||||
@@ -53,9 +53,8 @@
|
|||||||
>
|
>
|
||||||
<div slot="action" class="table-action" slot-scope="{text, record}">
|
<div slot="action" class="table-action" slot-scope="{text, record}">
|
||||||
<a class="action-dict" @click="editDictItem(record)">{{ $t('system.tag.dictionaryConfiguration') }}</a>
|
<a class="action-dict" @click="editDictItem(record)">{{ $t('system.tag.dictionaryConfiguration') }}</a>
|
||||||
<a class="action-edit" @click="handleEdit(record)">{{ $t('edit') }}</a>
|
<a class="action-edit" @click="handleEdit(record)" v-has="'sys:dict:operation'">{{ $t('edit') }}</a>
|
||||||
<a class="action-delete" href="javascript:;" @click="handleDelete(record.id)"
|
<a class="action-delete" @click="handleDelete(record.id)" v-has="'sys:dict:operation'">{{ $t('delete') }}</a>
|
||||||
>{{ $t('delete') }}</a>
|
|
||||||
</div>
|
</div>
|
||||||
</j-table>
|
</j-table>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user