|
|
@ -1,83 +1,39 @@
|
|
|
|
<template>
|
|
|
|
<template>
|
|
|
|
<div>
|
|
|
|
<div class="p20">
|
|
|
|
<BasicTable class="ds-table" @register="registerTable" @row-dbClick="handleAudit">
|
|
|
|
<BasicTable class="ds-table" @register="registerTable" @row-dbClick="handleAudit">
|
|
|
|
<template #tableTitle>
|
|
|
|
<template #tableTitle>
|
|
|
|
<div class="tableTitleBox">
|
|
|
|
<TableButton
|
|
|
|
<a-tooltip placement="top" :mouseEnterDelay="0.5">
|
|
|
|
:show="{ add: null, del: null, copy: null }"
|
|
|
|
<template #title>
|
|
|
|
@add="handleCreate"
|
|
|
|
<span>新建</span>
|
|
|
|
@del="handleDelete"
|
|
|
|
</template>
|
|
|
|
@copy="handleCopy"
|
|
|
|
<span class="ds-action-svg-btn">
|
|
|
|
|
|
|
|
<a-button v-repeat type="link" @click="handleCreate">
|
|
|
|
|
|
|
|
<img src="../../../assets/svg/infoclient/xinjian.svg" class="SvgImg" />
|
|
|
|
|
|
|
|
</a-button>
|
|
|
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
</a-tooltip>
|
|
|
|
|
|
|
|
<a-tooltip placement="top" :mouseEnterDelay="0.5">
|
|
|
|
|
|
|
|
<template #title>
|
|
|
|
|
|
|
|
<span>复制</span>
|
|
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<a-button v-repeat type="link" @click="handleCopy">
|
|
|
|
|
|
|
|
<img src="../../../assets/svg/infoclient/fuzhi.svg" class="SvgImg" />
|
|
|
|
|
|
|
|
</a-button>
|
|
|
|
|
|
|
|
</a-tooltip>
|
|
|
|
|
|
|
|
<a-tooltip placement="top" :mouseEnterDelay="0.5">
|
|
|
|
|
|
|
|
<template #title>
|
|
|
|
|
|
|
|
<span>删除</span>
|
|
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<span class="ds-action-svg-btn">
|
|
|
|
|
|
|
|
<a-popconfirm title="确定删除当前选中数据?" ok-text="是" cancel-text="否" @confirm="handleDelete">
|
|
|
|
|
|
|
|
<a-button v-repeat type="link">
|
|
|
|
|
|
|
|
<img src="../../../assets/svg/infoclient/shanchu.svg" class="SvgImg" />
|
|
|
|
|
|
|
|
</a-button>
|
|
|
|
|
|
|
|
</a-popconfirm>
|
|
|
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
</a-tooltip>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<!-- <a-button type="link" @click="handleCreate">
|
|
|
|
|
|
|
|
<span class="iconfont icon-new_document"></span>
|
|
|
|
|
|
|
|
添加
|
|
|
|
|
|
|
|
</a-button>
|
|
|
|
|
|
|
|
<a-popconfirm
|
|
|
|
|
|
|
|
title="确定删除当前选中数据?"
|
|
|
|
|
|
|
|
ok-text="是"
|
|
|
|
|
|
|
|
cancel-text="否"
|
|
|
|
|
|
|
|
@confirm="handleDelete"
|
|
|
|
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<a-button type="link">
|
|
|
|
</TableButton>
|
|
|
|
<span class="iconfont icon-shanchu21"></span>
|
|
|
|
|
|
|
|
删除
|
|
|
|
|
|
|
|
</a-button>
|
|
|
|
|
|
|
|
</a-popconfirm> -->
|
|
|
|
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
<template #bodyCell="{ column, record }">
|
|
|
|
<template #bodyCell="{ column, record }">
|
|
|
|
<template v-if="column.key === 'action'">
|
|
|
|
<template v-if="column.dataIndex === 'ruleType'">
|
|
|
|
<TableAction :actions="[
|
|
|
|
{{ record.ruleType == 'visible' ? '可视' : (record.ruleType == 'operate' ? '可操作' : '-') }}
|
|
|
|
{
|
|
|
|
</template>
|
|
|
|
icon: 'clarity:note-edit-line',
|
|
|
|
<template v-if="column.dataIndex == 'status'">
|
|
|
|
tooltip: '编辑',
|
|
|
|
<a-tag v-if="record.status == '0'" color="success">启用</a-tag>
|
|
|
|
onClick: handleAudit.bind(null, record),
|
|
|
|
<a-tag v-else color="error">禁用</a-tag>
|
|
|
|
},
|
|
|
|
|
|
|
|
]" />
|
|
|
|
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
</BasicTable>
|
|
|
|
</BasicTable>
|
|
|
|
<TenantAuditStepModal @register="registerModal" @success="handleSuccess" />
|
|
|
|
<TenantAuditStepModal @register="registerModal" @success="handleSuccess" />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
<script lang="ts" setup>
|
|
|
|
<script lang="ts" setup name="权限模版">
|
|
|
|
import { defineComponent, onMounted, ref } from 'vue'
|
|
|
|
import { BasicTable, useTable, TableAction } from '/@/components/Table'
|
|
|
|
import { BasicTable, useTable, TableAction, SorterResult } from '/@/components/Table'
|
|
|
|
|
|
|
|
import { ApiList, ApiDel, BatchCopyDataRuleTemplate } from './api'
|
|
|
|
import { ApiList, ApiDel, BatchCopyDataRuleTemplate } from './api'
|
|
|
|
import { useModal } from '/@/components/Modal'
|
|
|
|
import { useModal } from '/@/components/Modal'
|
|
|
|
import TenantAuditStepModal from './TenantAuditStepModal.vue'
|
|
|
|
import TenantAuditStepModal from './TenantAuditStepModal.vue'
|
|
|
|
import { columns, searchFormSchema } from './columns'
|
|
|
|
import { columns, searchFormSchema } from './columns'
|
|
|
|
import { formatParams } from '/@/hooks/web/common'
|
|
|
|
import { formatParams } from '/@/hooks/web/common'
|
|
|
|
import { useMessage } from '/@/hooks/web/useMessage'
|
|
|
|
import { useMessage } from '/@/hooks/web/useMessage'
|
|
|
|
const { notification } = useMessage()
|
|
|
|
const { createMessage } = useMessage()
|
|
|
|
const [registerModal, { openModal }] = useModal()
|
|
|
|
const [registerModal, { openModal }] = useModal()
|
|
|
|
const [registerTable, { reload, getSelectRows, getForm, getPaginationRef }] = useTable({
|
|
|
|
const [registerTable, { reload, getVxeSelectRows }] = useTable({
|
|
|
|
title: '',
|
|
|
|
|
|
|
|
api: async (p) => {
|
|
|
|
api: async (p) => {
|
|
|
|
const res: API.DataResult = await ApiList(p)
|
|
|
|
const res: API.DataResult = await ApiList(p)
|
|
|
|
return new Promise((resolve) => {
|
|
|
|
return new Promise((resolve) => {
|
|
|
@ -98,19 +54,12 @@ const [registerTable, { reload, getSelectRows, getForm, getPaginationRef }] = us
|
|
|
|
useSearchForm: true,
|
|
|
|
useSearchForm: true,
|
|
|
|
showTableSetting: true,
|
|
|
|
showTableSetting: true,
|
|
|
|
bordered: true,
|
|
|
|
bordered: true,
|
|
|
|
showIndexColumn: true,
|
|
|
|
|
|
|
|
indexColumnProps: {
|
|
|
|
|
|
|
|
width: 60,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
canResize: true,
|
|
|
|
canResize: true,
|
|
|
|
resizeHeightOffset: 35,
|
|
|
|
|
|
|
|
immediate: true,
|
|
|
|
immediate: true,
|
|
|
|
actionColumn: {
|
|
|
|
resizeHeightOffset: 45,
|
|
|
|
width: 80,
|
|
|
|
tableComponent: 'vxe',
|
|
|
|
title: '操作',
|
|
|
|
id: '0',
|
|
|
|
dataIndex: 'action',
|
|
|
|
autoHeight: window.innerHeight - 330.5
|
|
|
|
fixed: 'right',
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
// rowSelection: { type: 'checkbox' },
|
|
|
|
// rowSelection: { type: 'checkbox' },
|
|
|
|
// clickToRowSelect: false,
|
|
|
|
// clickToRowSelect: false,
|
|
|
|
})
|
|
|
|
})
|
|
|
@ -127,28 +76,28 @@ function handleAudit(record: Recordable) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function handleCopy() {
|
|
|
|
function handleCopy() {
|
|
|
|
let ids = []
|
|
|
|
let ids = []
|
|
|
|
ids = getSelectRows().map((item) => {
|
|
|
|
ids = getVxeSelectRows().map((item) => {
|
|
|
|
return item.id
|
|
|
|
return item.id
|
|
|
|
})
|
|
|
|
})
|
|
|
|
if (ids.length == 0) {
|
|
|
|
if (ids.length == 0) {
|
|
|
|
notification.error('请选择要复制的数据')
|
|
|
|
createMessage.warning('请选择要复制的数据')
|
|
|
|
return false
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
BatchCopyDataRuleTemplate({ids:ids}).then(res=>{
|
|
|
|
BatchCopyDataRuleTemplate({ids:ids}).then(res=>{
|
|
|
|
if(res.succeeded){
|
|
|
|
if(res.succeeded){
|
|
|
|
notification.success('复制成功')
|
|
|
|
createMessage.success('复制成功')
|
|
|
|
reload()
|
|
|
|
reload()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// 删除
|
|
|
|
// 删除
|
|
|
|
async function handleDelete(record: Recordable) {
|
|
|
|
async function handleDelete(record: Recordable) {
|
|
|
|
const select = getSelectRows()
|
|
|
|
const select = getVxeSelectRows()
|
|
|
|
let ApiData: any = {
|
|
|
|
let ApiData: any = {
|
|
|
|
ids: [],
|
|
|
|
ids: [],
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (select.length === 0) {
|
|
|
|
if (select.length === 0) {
|
|
|
|
notification.warning({ message: '请至少选择一条数据', duration: 3 })
|
|
|
|
createMessage.warning('请至少选择一条数据')
|
|
|
|
return false
|
|
|
|
return false
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
ApiData.ids = select.map((item) => {
|
|
|
|
ApiData.ids = select.map((item) => {
|
|
|
@ -158,19 +107,9 @@ async function handleDelete(record: Recordable) {
|
|
|
|
|
|
|
|
|
|
|
|
ApiDel(ApiData).then((res) => {
|
|
|
|
ApiDel(ApiData).then((res) => {
|
|
|
|
console.log(res)
|
|
|
|
console.log(res)
|
|
|
|
notification.success({ message: res.message, duration: 3 })
|
|
|
|
createMessage.success(res.message)
|
|
|
|
reload()
|
|
|
|
reload()
|
|
|
|
})
|
|
|
|
})
|
|
|
|
// const res: API.DataResult = await ApiDel({
|
|
|
|
|
|
|
|
// id: '',
|
|
|
|
|
|
|
|
// ids: [record.id],
|
|
|
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
// if (res.succeeded) {
|
|
|
|
|
|
|
|
// notification.success({ message: res.message, duration: 3 })
|
|
|
|
|
|
|
|
// reload()
|
|
|
|
|
|
|
|
// } else {
|
|
|
|
|
|
|
|
// notification.error({ message: res.message, duration: 3 })
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function handleSuccess() {
|
|
|
|
function handleSuccess() {
|
|
|
|
reload()
|
|
|
|
reload()
|
|
|
|