【update】标签管理修改成jtable
This commit is contained in:
@@ -151,10 +151,8 @@ export const SimpleListMixin = {
|
||||
this.$message.warning('请选择一条记录!')
|
||||
return
|
||||
}
|
||||
let ids = ''
|
||||
for (let a = 0; a < this.selectedRowKeys.length; a++) {
|
||||
ids += this.selectedRowKeys[a] + ','
|
||||
}
|
||||
|
||||
const ids = this.selectedRowKeys.join()
|
||||
const that = this
|
||||
this.$confirm({
|
||||
title: '确认删除',
|
||||
|
||||
@@ -311,7 +311,6 @@ export default {
|
||||
},
|
||||
{
|
||||
title: this.$t('operation'),
|
||||
dataIndex: 'action',
|
||||
scopedSlots: { customRender: 'action' },
|
||||
align: 'center',
|
||||
width: 170
|
||||
|
||||
@@ -119,12 +119,15 @@ export default {
|
||||
this.model.dictCode = (this.model.dictCode || '').trim()
|
||||
this.model.description = (this.model.description || '').trim()
|
||||
let obj
|
||||
const formData = Object.assign({}, this.model)
|
||||
if (!this.model.id) {
|
||||
obj = addDict(this.model)
|
||||
obj = addDict
|
||||
} else {
|
||||
obj = editDict(this.model)
|
||||
obj = editDict
|
||||
}
|
||||
obj.then((res) => {
|
||||
// 重要,设置为数据字典内容
|
||||
formData.isTagDict = 0
|
||||
obj(formData).then((res) => {
|
||||
if (res.success) {
|
||||
that.$message.success(res.message)
|
||||
that.$emit('ok')
|
||||
|
||||
@@ -119,7 +119,6 @@ export default {
|
||||
},
|
||||
{
|
||||
title: this.$t('operation'),
|
||||
dataIndex: 'action',
|
||||
scopedSlots: { customRender: 'action' },
|
||||
align: 'left',
|
||||
width: 60
|
||||
|
||||
@@ -41,13 +41,13 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<a-table
|
||||
<j-table
|
||||
ref="table"
|
||||
can-drag
|
||||
:class="{'tree-table': attributeType === TagsAttributeTypeEnums.TREE.value}"
|
||||
:bordered="true"
|
||||
size="middle"
|
||||
rowKey="id"
|
||||
:components="drag(columns,'columns')"
|
||||
:columns="columns"
|
||||
:dataSource="dataSource"
|
||||
:pagination="attributeType === TagsAttributeTypeEnums.TREE.value ? false : ipagination"
|
||||
@@ -55,18 +55,11 @@
|
||||
:scroll="{x: '100%'}"
|
||||
:rowSelection="{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" 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="table-del" @click="handleDelete(record.id)">{{ $t('delete') }}</a>
|
||||
</div>
|
||||
</a-table>
|
||||
</j-table>
|
||||
</div>
|
||||
<tag-content-dict-item-modal ref="modalForm" :attribute-type="attributeType" @ok="modalFormOk"></tag-content-dict-item-modal>
|
||||
</a-drawer>
|
||||
@@ -74,24 +67,24 @@
|
||||
|
||||
<script>
|
||||
import '@assets/less/common.less'
|
||||
import { ResizeColumnProvide, ResizeHeader } from '../../../../mixins/header'
|
||||
import TagContentDictItemModal from './TagContentDictItemModal'
|
||||
import { SimpleListMixin } from '../../../../mixins/SimpleListMixin'
|
||||
import { TagsAttributeTypeEnums } from '../../../../enums/commonEnums'
|
||||
import JTable from '../../../../components/jero/JTable'
|
||||
|
||||
export default {
|
||||
name: 'TagContentDictListDrawer',
|
||||
mixins: [SimpleListMixin, ResizeHeader, ResizeColumnProvide],
|
||||
mixins: [SimpleListMixin],
|
||||
components: {
|
||||
// JDictSelectTag
|
||||
TagContentDictItemModal
|
||||
TagContentDictItemModal,
|
||||
JTable
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
TagsAttributeTypeEnums,
|
||||
visible: false,
|
||||
title: this.$t('system.tag.dictionaryConfiguration'),
|
||||
width: 800,
|
||||
width: 1000,
|
||||
confirmLoading: false,
|
||||
commonColumns: [
|
||||
{
|
||||
@@ -122,7 +115,6 @@ export default {
|
||||
},
|
||||
{
|
||||
title: this.$t('operation'),
|
||||
dataIndex: 'action',
|
||||
scopedSlots: { customRender: 'action' },
|
||||
align: 'left',
|
||||
width: 170
|
||||
@@ -135,7 +127,9 @@ export default {
|
||||
key: 'itemText',
|
||||
align: 'left',
|
||||
ellipsis: true,
|
||||
width: 150
|
||||
width: 150,
|
||||
// 必须增加 为了过滤掉组件本身的插槽
|
||||
scopedSlots: { customRender: '' }
|
||||
}
|
||||
],
|
||||
listColumn: [
|
||||
|
||||
@@ -31,12 +31,12 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<a-table
|
||||
<j-table
|
||||
ref="table"
|
||||
:bordered="true"
|
||||
size="middle"
|
||||
rowKey="id"
|
||||
:components="drag(columns,'columns')"
|
||||
can-drag
|
||||
:columns="columns"
|
||||
:dataSource="dataSource"
|
||||
:pagination="ipagination"
|
||||
@@ -57,22 +57,24 @@
|
||||
<a class="table-del" v-if="record.isReadOnly===2 || record.isReadOnly===0" v-has="'tag:logicDelete'" @click="handleDelete(record.id)"
|
||||
>{{ $t('delete') }}</a>
|
||||
</div>
|
||||
</a-table>
|
||||
</j-table>
|
||||
<clause-splitting-drawer ref="modalForm" v-bind="$props" @ok="modalFormOk"></clause-splitting-drawer>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import { ResizeColumnProvide, ResizeHeader } from '../../../../mixins/header'
|
||||
import '@assets/less/common.less'
|
||||
import ClauseSplittingDrawer from '../modules/ClauseSplittingDrawer'
|
||||
import { SimpleListMixin } from '../../../../mixins/SimpleListMixin'
|
||||
import JTable from '../../../../components/jero/JTable'
|
||||
|
||||
export default {
|
||||
name: 'ClauseSplittingList',
|
||||
mixins: [SimpleListMixin, ResizeHeader, ResizeColumnProvide],
|
||||
mixins: [SimpleListMixin],
|
||||
components: {
|
||||
ClauseSplittingDrawer
|
||||
ClauseSplittingDrawer,
|
||||
JTable
|
||||
},
|
||||
props: {
|
||||
type: {
|
||||
@@ -124,7 +126,6 @@ export default {
|
||||
},
|
||||
{
|
||||
title: this.$t('operation'),
|
||||
dataIndex: 'action',
|
||||
scopedSlots: { customRender: 'action' },
|
||||
align: 'left',
|
||||
width: 170
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
<!-- 国内法规-->
|
||||
<template>
|
||||
<div>
|
||||
{{$props}}--{{type}}
|
||||
<div class="table-page-search-wrapper">
|
||||
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
||||
<a-row :gutter="24">
|
||||
@@ -47,33 +46,24 @@
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<a-table
|
||||
ref="table"
|
||||
:bordered="true"
|
||||
size="middle"
|
||||
<j-table
|
||||
rowKey="id"
|
||||
:components="drag(columns,'columns')"
|
||||
can-drag
|
||||
:columns="columns"
|
||||
:dataSource="dataSource"
|
||||
:pagination="ipagination"
|
||||
:loading="loading"
|
||||
:scroll="{x: '100%'}"
|
||||
:rowSelection="{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>
|
||||
<!--TODO 需要查看下是否有这个字段,并且看一下判断是否必然-->
|
||||
<div slot="action" class="table-action" slot-scope="text, record">
|
||||
@change="handleTableChange"
|
||||
>
|
||||
<!--todo 需要查看下是否有这个字段,并且看一下判断是否必然-->
|
||||
<div slot="action" class="table-action" slot-scope="{text, record}">
|
||||
<a class="action-edit" @click="handleEdit(record)" v-if="record.isReadOnly===0" v-has="'tag:edit'"
|
||||
>{{ $t('edit') }}</a>
|
||||
<a class="table-del" v-if="record.isReadOnly===2 || record.isReadOnly===0" v-has="'tag:logicDelete'" @click="handleDelete(record.id)"
|
||||
>{{ $t('delete') }}</a>
|
||||
</div>
|
||||
</a-table>
|
||||
</j-table>
|
||||
</div>
|
||||
<!--新增字段-->
|
||||
<standard-drawer ref="modalForm" v-bind="$props" @ok="modalFormOk"></standard-drawer>
|
||||
@@ -84,19 +74,20 @@
|
||||
|
||||
<script>
|
||||
import { getShowAreaData } from '../../../../api/api'
|
||||
import { ResizeColumnProvide, ResizeHeader } from '../../../../mixins/header'
|
||||
|
||||
import '@assets/less/common.less'
|
||||
import StandardDrawer from '../modules/StandardDrawer'
|
||||
import AreaModal from '../modules/AreaModal'
|
||||
import { SimpleListMixin } from '../../../../mixins/SimpleListMixin'
|
||||
import JTable from '../../../../components/jero/JTable'
|
||||
|
||||
export default {
|
||||
name: 'StandardList',
|
||||
mixins: [SimpleListMixin, ResizeHeader, ResizeColumnProvide],
|
||||
mixins: [SimpleListMixin],
|
||||
components: {
|
||||
StandardDrawer,
|
||||
AreaModal
|
||||
AreaModal,
|
||||
JTable
|
||||
},
|
||||
props: {
|
||||
type: {
|
||||
@@ -120,46 +111,45 @@ export default {
|
||||
columns: [
|
||||
{
|
||||
title: this.$t('system.tag.attributeName'),
|
||||
align: 'left',
|
||||
width: 100,
|
||||
dataIndex: 'dbFieldTxt'
|
||||
width: 170,
|
||||
dataIndex: 'dbFieldTxt',
|
||||
scopedSlots: { customRender: 'text' }
|
||||
},
|
||||
{
|
||||
title: this.$t('system.tag.attributeNameEnglish'),
|
||||
align: 'left',
|
||||
width: 100,
|
||||
dataIndex: 'dbFieldEnName'
|
||||
width: 170,
|
||||
dataIndex: 'dbFieldEnName',
|
||||
scopedSlots: { customRender: 'text' }
|
||||
},
|
||||
{
|
||||
title: this.$t('system.tag.attributeType'),
|
||||
align: 'left',
|
||||
width: 100,
|
||||
dataIndex: 'fieldShowTypeName'
|
||||
width: 170,
|
||||
dataIndex: 'fieldShowType_dictText',
|
||||
scopedSlots: { customRender: 'text' }
|
||||
},
|
||||
{
|
||||
title: this.$t('system.tag.fieldLength'),
|
||||
align: 'left',
|
||||
width: 80,
|
||||
dataIndex: 'dbLength'
|
||||
width: 170,
|
||||
dataIndex: 'dbLength',
|
||||
scopedSlots: { customRender: 'text' }
|
||||
},
|
||||
{
|
||||
title: this.$t('system.tag.displayOrder'),
|
||||
align: 'left',
|
||||
width: 80,
|
||||
dataIndex: 'orderNum'
|
||||
width: 170,
|
||||
dataIndex: 'orderNum',
|
||||
scopedSlots: { customRender: 'text' }
|
||||
},
|
||||
{
|
||||
title: this.$t('system.tag.showArea'),
|
||||
align: 'left',
|
||||
width: 80,
|
||||
dataIndex: 'showAreaName'
|
||||
width: 170,
|
||||
dataIndex: 'showArea_dictText',
|
||||
scopedSlots: { customRender: 'text' }
|
||||
},
|
||||
{
|
||||
title: this.$t('operation'),
|
||||
dataIndex: 'action',
|
||||
scopedSlots: { customRender: 'action' },
|
||||
align: 'left',
|
||||
width: 170
|
||||
align: 'center',
|
||||
width: 150
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -39,10 +39,10 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<a-table
|
||||
<j-table
|
||||
class="tag-con-table"
|
||||
rowKey="id"
|
||||
:components="drag(columns,'columns')"
|
||||
can-drag
|
||||
:data-source="dataSource"
|
||||
:pagination="ipagination"
|
||||
:loading="loading"
|
||||
@@ -51,21 +51,13 @@
|
||||
: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" 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>
|
||||
<!--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)"
|
||||
<a class="action-delete" href="javascript:;" @click="handleDelete(record.id)"
|
||||
>{{ $t('delete') }}</a>
|
||||
</div>
|
||||
</a-table>
|
||||
</j-table>
|
||||
|
||||
<!-- 新增、编辑 -->
|
||||
<tag-content-modal ref="modalForm" @ok="modalFormOk"></tag-content-modal>
|
||||
@@ -77,19 +69,20 @@
|
||||
|
||||
<script>
|
||||
import '@assets/less/common.less'
|
||||
import { ResizeColumnProvide, ResizeHeader } from '../../../../mixins/header'
|
||||
import TagContentModal from '../modules/TagContentModal'
|
||||
import TagContentDictListDrawer from '../modules/TagContentDictListDrawer'
|
||||
import JDictSelectTag from '../../../../components/dict/JDictSelectTag'
|
||||
import { SimpleListMixin } from '../../../../mixins/SimpleListMixin'
|
||||
import JTable from '../../../../components/jero/JTable'
|
||||
|
||||
export default {
|
||||
name: 'TagContent',
|
||||
mixins: [SimpleListMixin, ResizeHeader, ResizeColumnProvide],
|
||||
mixins: [SimpleListMixin],
|
||||
components: {
|
||||
TagContentModal,
|
||||
TagContentDictListDrawer,
|
||||
JDictSelectTag
|
||||
JDictSelectTag,
|
||||
JTable
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
@@ -98,8 +91,8 @@ export default {
|
||||
title: this.$t('system.tag.labelName'),
|
||||
dataIndex: 'dictName',
|
||||
key: 'dictName',
|
||||
align: 'left',
|
||||
ellipsis: true,
|
||||
// align: 'left',
|
||||
// ellipsis: true,
|
||||
width: 100,
|
||||
scopedSlots: { customRender: 'text' }
|
||||
},
|
||||
@@ -115,7 +108,7 @@ export default {
|
||||
align: 'left',
|
||||
dataIndex: 'description',
|
||||
ellipsis: true,
|
||||
width: 300,
|
||||
width: 200,
|
||||
scopedSlots: { customRender: 'text' }
|
||||
},
|
||||
{
|
||||
@@ -127,7 +120,6 @@ export default {
|
||||
},
|
||||
{
|
||||
title: this.$t('operation'),
|
||||
dataIndex: 'action',
|
||||
scopedSlots: { customRender: 'action' },
|
||||
align: 'left',
|
||||
width: 170
|
||||
@@ -135,7 +127,9 @@ export default {
|
||||
],
|
||||
// dataSource: [],
|
||||
url: {
|
||||
list: 'sys/dict/tagDictPage'
|
||||
list: 'sys/dict/tagDictPage',
|
||||
delete: 'sys/dict/delete',
|
||||
deleteBatch: 'sys/dict/deleteBatch'
|
||||
},
|
||||
// 增加其他的查询条件
|
||||
filters: {
|
||||
|
||||
Reference in New Issue
Block a user