|
@@ -2,9 +2,10 @@
|
|
|
<PageWrapper contentBackground>
|
|
|
<template #footer>
|
|
|
<a-tabs v-model:activeKey="state" @change="changeTable">
|
|
|
- <a-tab-pane :key="1" tab="所在行业" />
|
|
|
- <a-tab-pane :key="2" tab="硬件产品" />
|
|
|
+ <a-tab-pane v-for="item in list" :key="item.id" :tab="item.name" />
|
|
|
+ <!-- <a-tab-pane :key="2" tab="硬件产品" />
|
|
|
<a-tab-pane :key="3" tab="软件产品" />
|
|
|
+ <a-tab-pane :key="4" tab="场景分类" /> -->
|
|
|
</a-tabs>
|
|
|
<a-button style="position: absolute; right: 20px; top: 30px;" @click="router.go(-1)"> 返回 </a-button>
|
|
|
</template>
|
|
@@ -16,11 +17,22 @@
|
|
|
新增
|
|
|
</a-button>
|
|
|
</template>
|
|
|
+ <template #copy="{ text }">
|
|
|
+ <a @click="handleCopy(text)">
|
|
|
+ {{ text }}
|
|
|
+ </a>
|
|
|
+ </template>
|
|
|
<template #action="{ record }">
|
|
|
<TableAction
|
|
|
stopButtonPropagation
|
|
|
:actions="[
|
|
|
{
|
|
|
+ label: '配置',
|
|
|
+ //icon: 'icon-park-outline:door-handle',
|
|
|
+ ifShow: getCheckPerm('configuration-config') && state == 4,
|
|
|
+ onClick: handleConfig.bind(null, record),
|
|
|
+ },
|
|
|
+ {
|
|
|
label: '编辑',
|
|
|
//icon: 'icon-park-outline:door-handle',
|
|
|
ifShow: getCheckPerm('configuration-edit'),
|
|
@@ -37,20 +49,23 @@
|
|
|
</template>
|
|
|
</BasicTable>
|
|
|
</div>
|
|
|
- <addconfigModal :typeId="state" @register="register" @update="reload" />
|
|
|
+ <addConfigModal :typeId="state" @register="registerConfig" @update="reload" />
|
|
|
+ <addModal :typeId="state" @register="register" @update="reload" />
|
|
|
</PageWrapper>
|
|
|
</template>
|
|
|
<script lang="ts">
|
|
|
- import { defineComponent, ref, h } from 'vue';
|
|
|
+ import { defineComponent, ref, h, onMounted } from 'vue';
|
|
|
import { BasicTable, useTable, TableAction, FormProps } from '/@/components/Table';
|
|
|
import { PageWrapper } from '/@/components/Page';
|
|
|
import { Divider, Card, Empty, Descriptions, Steps, Tabs } from 'ant-design-vue';
|
|
|
- import { getAllByTypeId, feedbackOptionList, feedbackOptiondelete } from '/@/api/operate';
|
|
|
+ import { getAllByTypeId, feedbackOptionTypeList, feedbackOptionList, feedbackOptiondelete } from '/@/api/operate';
|
|
|
import { useI18n } from '/@/hooks/web/useI18n';
|
|
|
- import addconfigModal from './components/config/addModal.vue';
|
|
|
+ import addConfigModal from './components/config/addConfigModal.vue';
|
|
|
+ import addModal from './components/config/addModal.vue';
|
|
|
import { useModal } from '/@/components/Modal';
|
|
|
- import { configurationSchema, refundTimeTableData } from './data';
|
|
|
+ import { configurationSchema, refundTimeTableData, configurationSchema1, configurationSchema2 } from './data';
|
|
|
import { useMessage } from '/@/hooks/web/useMessage';
|
|
|
+ import { copyTextToClipboard } from '/@/hooks/web/useCopyToClipboard';
|
|
|
import { useRouter } from 'vue-router';
|
|
|
import { usePermissionStore } from '/@/store/modules/permission';
|
|
|
export default defineComponent({
|
|
@@ -58,7 +73,8 @@
|
|
|
BasicTable,
|
|
|
PageWrapper,
|
|
|
TableAction,
|
|
|
- addconfigModal,
|
|
|
+ addConfigModal,
|
|
|
+ addModal,
|
|
|
[Divider.name]: Divider,
|
|
|
[Card.name]: Card,
|
|
|
Empty,
|
|
@@ -73,10 +89,18 @@
|
|
|
const { t } = useI18n();
|
|
|
const router = useRouter();
|
|
|
const [register, { openModal }] = useModal();
|
|
|
+ const [registerConfig, { openModal: openConfigModal }] = useModal();
|
|
|
const permissionStore = usePermissionStore();
|
|
|
const { getCheckPerm } = permissionStore;
|
|
|
const { createMessage, createConfirm } = useMessage();
|
|
|
const state = ref<number>(1); //未处理,0已处理(默认1)
|
|
|
+ const list = ref([{
|
|
|
+ name: '所在行业',
|
|
|
+ id: 1,
|
|
|
+ }]);
|
|
|
+ feedbackOptionTypeList({}).then((res) => {
|
|
|
+ list.value = res;
|
|
|
+ });
|
|
|
const searchForm: Partial<FormProps> = {
|
|
|
labelWidth: 100,
|
|
|
autoSubmitOnEnter: true,
|
|
@@ -107,7 +131,7 @@
|
|
|
},
|
|
|
],
|
|
|
};
|
|
|
- const [registerTimeTable, { reload }] = useTable({
|
|
|
+ const [registerTimeTable, { reload, setColumns }] = useTable({
|
|
|
api: feedbackOptionList,
|
|
|
// title: '',
|
|
|
rowKey: 'id',
|
|
@@ -130,7 +154,7 @@
|
|
|
// pagination: { pageSize: 20 },
|
|
|
// scroll: { y: 300 },
|
|
|
actionColumn: {
|
|
|
- width: 100,
|
|
|
+ width: 130,
|
|
|
title: '操作',
|
|
|
// ifShow:state.value == 1,
|
|
|
dataIndex: 'action',
|
|
@@ -139,6 +163,11 @@
|
|
|
});
|
|
|
function changeTable(val: string) {
|
|
|
state.value = val;
|
|
|
+ let columnsObj = {
|
|
|
+ 4: configurationSchema1,
|
|
|
+ 5: configurationSchema2,
|
|
|
+ }
|
|
|
+ setColumns(columnsObj[val] || configurationSchema);
|
|
|
reload();
|
|
|
}
|
|
|
async function handleWithdraw(record: Recordable) {
|
|
@@ -147,6 +176,13 @@
|
|
|
function handleEidt(record) {
|
|
|
openModal(true, record);
|
|
|
}
|
|
|
+ function handleConfig(record) {
|
|
|
+ openConfigModal(true, record);
|
|
|
+ }
|
|
|
+ function handleCopy(str: string) {
|
|
|
+ copyTextToClipboard(str);
|
|
|
+ createMessage.success('复制成功');
|
|
|
+ }
|
|
|
async function handleDelete(record: Recordable) {
|
|
|
createConfirm({
|
|
|
iconType: 'warning',
|
|
@@ -159,6 +195,10 @@
|
|
|
},
|
|
|
});
|
|
|
}
|
|
|
+ onMounted(async () => {
|
|
|
+ let res = await feedbackOptionTypeList({});
|
|
|
+ console.log('feedbackOptionTypeList', res);
|
|
|
+ });
|
|
|
return {
|
|
|
registerTimeTable,
|
|
|
handleWithdraw,
|
|
@@ -166,11 +206,15 @@
|
|
|
state,
|
|
|
reload,
|
|
|
register,
|
|
|
+ registerConfig,
|
|
|
openModal,
|
|
|
getCheckPerm,
|
|
|
handleEidt,
|
|
|
+ handleConfig,
|
|
|
handleDelete,
|
|
|
+ handleCopy,
|
|
|
router,
|
|
|
+ list,
|
|
|
};
|
|
|
},
|
|
|
});
|