Browse Source

删除不需要的页面

louhangfei 2 years ago
parent
commit
6a15f946c0

+ 0 - 275
src/views/article/CreateModal.vue

@@ -1,275 +0,0 @@
-<template>
-  <basicModal
-    @register="modalRegister"
-    ref="modalRef"
-    class="basicModal basicFormModal"
-    @ok="okModal"
-    @close="handleReset"
-  >
-    <template #default>
-      <el-form
-        :model="formParams"
-        :rules="rules"
-        ref="formRef"
-        label-placement="left"
-        :label-width="80"
-        class="mt-6"
-      >
-        <el-form-item label="标题" prop="title">
-          <el-input placeholder="请输入标题" v-model="formParams.title" />
-        </el-form-item>
-
-        <el-form-item label="内容" prop="content">
-          <div class="editor-container">
-            <Toolbar
-              style="border-bottom: 1px solid #ccc"
-              :editor="editorRef"
-              :defaultConfig="toolbarConfig"
-              :mode="mode"
-            />
-            <Editor
-              style="height: 350px; overflow-y: hidden"
-              v-model="formParams.content"
-              :defaultConfig="editorConfig"
-              :mode="mode"
-              @on-created="handleCreated"
-            />
-          </div>
-        </el-form-item>
-        <el-form-item label="发布时间" prop="publicTime">
-          <el-date-picker
-            v-model="formParams.publicTime"
-            value-format="yyyy-MM-dd HH:mm:ss"
-            type="datetime"
-            clearable
-          />
-        </el-form-item>
-      </el-form>
-    </template>
-  </basicModal>
-</template>
-
-<script lang="ts" setup>
-  import { onBeforeUnmount, reactive, ref, shallowRef, nextTick } from 'vue';
-
-  import { ElMessage } from 'element-plus';
-  import type { formParamsType } from './types';
-  import { basicModal, useModal } from '@/components/Modal';
-  import { addArticle, editArticle, articleInfo } from '@/api/article/index';
-
-  import '@wangeditor/editor/dist/css/style.css'; // 引入 css
-
-  import { Editor, Toolbar } from '@wangeditor/editor-for-vue';
-  import { useUserStoreWidthOut } from '@/store/modules/user';
-  import { useGlobSetting } from '@/hooks/setting';
-
-  const rules = {
-    title: {
-      required: true,
-      message: '标题不能为空',
-      trigger: 'blur',
-    },
-    content: {
-      required: true,
-      message: '内容不能为空',
-      trigger: 'blur',
-    },
-    publicTime: {
-      required: true,
-      message: '发布时间不能为空',
-      trigger: 'change',
-    },
-  };
-
-  const emit = defineEmits(['change', 'register']);
-
-  const props = defineProps({
-    title: {
-      type: String,
-      default: '添加文章',
-    },
-    width: {
-      type: Number,
-      default: 450,
-    },
-  });
-
-  const message = ElMessage;
-  const formRef: any = ref(null);
-  const isDrawer = ref(false);
-  const userStore = useUserStoreWidthOut();
-  const token = userStore.getToken;
-
-  const [modalRegister, { openModal, closeModal, setSubLoading, setProps }] = useModal({
-    title: props.title,
-    subBtuText: '保存',
-    width: 950,
-  });
-
-  const defaultValueRef = () => ({
-    id: null,
-    content: '',
-    title: '',
-    publicTime: undefined,
-  });
-
-  const formParams = ref<formParamsType>(defaultValueRef());
-
-  // 编辑器实例,必须用 shallowRef
-  const editorRef = shallowRef();
-  const globSetting = useGlobSetting();
-  const mode = ref('default'); // 或 'simple'
-  const { uploadUrl, imgUrl } = globSetting;
-  const uploadHeaders = reactive({
-    satoken: token,
-  });
-
-  // 内容 HTML
-  const valueHtml = ref(formParams.value.content);
-
-  type InsertFnType = (url: string, alt?: string, href?: string) => void;
-
-  const toolbarConfig = {};
-  const editorConfig = reactive({
-    MENU_CONF: {
-      uploadImage: {
-        fieldName: 'file',
-        headers: uploadHeaders,
-        meta: {
-          type: 0,
-        },
-        server: `${uploadUrl}/api/file/do_upload_action`,
-        // 自定义插入图片
-        customInsert(res: any, insertFn: InsertFnType) {
-          // res 即服务端的返回结果
-          // 从 res 中找到 url alt href ,然后插图图片
-          if (res.code === 200) {
-            insertFn(imgUrl + res.data.filePath);
-          }
-        },
-      },
-    },
-    placeholder: '请输入内容...',
-  });
-
-  // 组件销毁时,也及时销毁编辑器
-  onBeforeUnmount(() => {
-    const editor = editorRef.value;
-    if (editor == null) return;
-    editor.destroy();
-  });
-
-  const handleCreated = (editor) => {
-    editorRef.value = editor; // 记录 editor 实例,重要!
-  };
-
-  async function showModal(id?) {
-    if (id) {
-      formParams.value.id = id;
-      setProps({
-        title: '编辑文章',
-      });
-      getInfo();
-      return;
-    }
-    setProps({
-      title: '添加文章',
-    });
-    openModal();
-  }
-
-  function okModal() {
-    formRef.value.validate((valid) => {
-      if (!valid) {
-        setSubLoading(false);
-        return message.error('请填写完整信息');
-      }
-      const msg = formParams.value.id ? '编辑成功' : '添加成功';
-      if (formParams.value.id) {
-        editArticle(formParams.value)
-          .then((_) => {
-            message.success(msg);
-            setSubLoading(false);
-            emit('change');
-            handleReset();
-            closeModal();
-          })
-          .catch(() => {
-            setSubLoading(false);
-          });
-      } else {
-        addArticle(formParams.value)
-          .then((_) => {
-            message.success(msg);
-            setSubLoading(false);
-            emit('change');
-            handleReset();
-            closeModal();
-          })
-          .catch(() => {
-            setSubLoading(false);
-          });
-      }
-    });
-  }
-
-  function handleReset() {
-    formRef.value.resetFields();
-    formParams.value = Object.assign(formParams.value, defaultValueRef());
-  }
-
-  function getInfo() {
-    articleInfo({ id: formParams.value.id }).then((res) => {
-      const params = {
-        id: res.id,
-        title: res.title,
-        content: res.content,
-        publicTime: res.publicTime,
-      };
-      formParams.value = Object.assign(formParams.value, params);
-      isDrawer.value = true;
-      valueHtml.value = res.content;
-      openModal();
-    });
-  }
-
-  defineExpose({
-    showModal,
-    closeModal,
-  });
-</script>
-
-<style lang="scss" scoped>
-  .editor-container {
-    border: 1px solid #e5e7eb;
-    z-index: 100;
-    dl,
-    dd,
-    h1,
-    h2,
-    h3,
-    h4,
-    h5,
-    h6,
-    hr,
-    figure,
-    p,
-    pre {
-      margin: revert;
-    }
-    h1,
-    h2,
-    h3,
-    h4,
-    h5,
-    h6 {
-      font-size: revert;
-      font-weight: revert;
-    }
-    ul {
-      list-style: circle;
-      margin: revert;
-      padding: revert;
-    }
-  }
-</style>

+ 0 - 132
src/views/article/ImportModal.vue

@@ -1,132 +0,0 @@
-<template>
-  <basicModal @register="modalRegister" ref="modalRef">
-    <template #default>
-      <el-form :model="formParams" ref="formRef" label-placement="left" :label-width="80">
-        <el-form-item label="导入步骤">
-          <el-alert title="请先下载模板,按约定格式填写文章内容,从下面选择模板导入" type="info" />
-        </el-form-item>
-
-        <el-form-item label="下载模板">
-          <el-button type="primary" plain @click="downloadTemp"> 立即下载 </el-button>
-        </el-form-item>
-
-        <el-form-item label="文章模板">
-          <el-upload
-            :action="`${uploadUrl}${urlPrefix}/article/import`"
-            :headers="uploadHeaders"
-            :show-file-list="false"
-            :show-retry-button="false"
-            accept=".xls,.xlsx"
-            @finish="importChange"
-          >
-            <el-button type="primary" :loading="importBtn">
-              <template #icon>
-                <ImportOutlined />
-              </template>
-              选择模板
-            </el-button>
-          </el-upload>
-        </el-form-item>
-      </el-form>
-    </template>
-    <template #action></template>
-  </basicModal>
-</template>
-
-<script lang="ts" setup>
-  import { reactive, ref } from 'vue';
-  import { ElMessage, ElNotification } from 'element-plus';
-  import type { formParamsType } from './types';
-  import { basicModal, useModal } from '@/components/Modal';
-  import { useGlobSetting } from '@/hooks/setting';
-  import { useUserStore } from '@/store/modules/user';
-  import { ImportOutlined } from '@vicons/antd';
-
-  const globSetting = useGlobSetting();
-
-  const { uploadUrl, urlPrefix } = globSetting;
-  const userStore = useUserStore();
-
-  const importBtn = ref(false);
-
-  const emit = defineEmits(['change', 'register']);
-
-  const props = defineProps({
-    title: {
-      type: String,
-      default: '导入文章',
-    },
-    width: {
-      type: Number,
-      default: 450,
-    },
-  });
-
-  const message = ElMessage;
-  const formRef: any = ref(null);
-  const token = userStore.getToken;
-
-  const [modalRegister, { openModal, closeModal }] = useModal({
-    title: props.title,
-    subBtuText: '保存',
-    width: 550,
-    showAction: false,
-    hideFooter: true,
-  });
-
-  const defaultValueRef = () => ({
-    id: null,
-    content: '',
-    title: '',
-    publicTime: undefined,
-  });
-
-  const formParams = ref<formParamsType>(defaultValueRef());
-
-  const uploadHeaders = reactive({
-    satoken: token,
-  });
-
-  // 下载模板
-  function downloadTemp() {
-    const downFile = document.createElement('a');
-    downFile.style.display = 'none';
-    downFile.href = '/xlsx/article.xls';
-    downFile.download = 'article.xls'; // 下载后文件名
-    document.body.appendChild(downFile);
-    downFile.click();
-    document.body.removeChild(downFile); // 下载完成移除元素
-  }
-
-  function importChange({ event }: { file; event?: any }) {
-    if (event && event.target) {
-      try {
-        const res = eval('(' + event.target.response + ')');
-        const { code, data, msg } = res;
-        //成功
-        if (code === 200) {
-          ElNotification({
-            title: '提示',
-            message: `导入总数:${data.totalCount}条,成功 ${data.sucCount}条,失败 ${data.failCount}条`,
-            type: data.isSuc ? 'success' : 'danger',
-          });
-          emit('change');
-          closeModal();
-        } else message.error(msg);
-      } catch (error) {
-        console.error(error);
-      }
-    }
-  }
-
-  async function showModal() {
-    openModal();
-  }
-
-  defineExpose({
-    showModal,
-    closeModal,
-  });
-</script>
-
-<style lang="scss" scoped></style>

+ 0 - 16
src/views/article/columns.ts

@@ -1,16 +0,0 @@
-import { BasicColumn } from '@/components/Table';
-
-export const columns: BasicColumn[] = [
-  {
-    label: 'ID',
-    prop: 'id',
-  },
-  {
-    label: '标题',
-    prop: 'title',
-  },
-  {
-    label: '发布时间',
-    prop: 'publicTime',
-  },
-];

+ 0 - 200
src/views/article/list.vue

@@ -1,200 +0,0 @@
-<template>
-  <PageWrapper>
-    <el-card :bordered="false" class="mb-3 proCard">
-      <el-space align="center">
-        <el-input
-          :style="{ width: '320px' }"
-          v-model="params.title"
-          clearable
-          placeholder="请输入标题"
-          @keyup.enter="reloadTable"
-        />
-        <el-button type="primary" @click="reloadTable">
-          <template #icon>
-            <el-icon>
-              <SearchOutlined />
-            </el-icon>
-          </template>
-          查询
-        </el-button>
-      </el-space>
-    </el-card>
-    <el-card :bordered="false" class="proCard">
-      <BasicTable
-        :columns="columns"
-        :request="loadDataTable"
-        :row-key="(row) => row.postId"
-        ref="basicTableRef"
-        :actionColumn="actionColumn"
-        @update:checked-row-keys="onCheckedRow"
-        virtual-scroll
-      >
-        <template #tableTitle>
-          <el-space align="center">
-            <el-button type="primary" @click="openCreateDrawer">
-              <template #icon>
-                <el-icon>
-                  <FileAddOutlined />
-                </el-icon>
-              </template>
-              添加
-            </el-button>
-            <el-button type="success" @click="handelExportArticle">
-              <template #icon>
-                <el-icon>
-                  <ExportOutlined />
-                </el-icon>
-              </template>
-              导出
-            </el-button>
-            <el-button type="warning" @click="handelImportArticle">
-              <template #icon>
-                <el-icon>
-                  <ImportOutlined />
-                </el-icon>
-              </template>
-              导入
-            </el-button>
-          </el-space>
-        </template>
-      </BasicTable>
-    </el-card>
-
-    <createModal
-      ref="createModalRef"
-      :title="drawerTitle"
-      :roleList="roleData"
-      @change="reloadTable"
-    />
-    <ImportModal ref="importModalRef" @change="reloadTable" />
-  </PageWrapper>
-</template>
-
-<script lang="ts" setup>
-  import { h, reactive, ref } from 'vue';
-  import { ElMessage, ElLoading } from 'element-plus';
-  import { BasicTable, TableAction, BasicColumn } from '@/components/Table';
-  import { articleList, deleteArticle, exportArticle } from '@/api/article/index';
-  import { FileAddOutlined, SearchOutlined, ExportOutlined, ImportOutlined } from '@vicons/antd';
-  import createModal from './CreateModal.vue';
-  import ImportModal from './ImportModal.vue';
-  import { columns } from './columns';
-  import { downloadFile } from '@/utils';
-
-  const message = ElMessage;
-  const basicTableRef = ref();
-  const rowKeys = ref([]);
-  const rowKeysName = ref([]);
-  const tableData = ref();
-  const createModalRef = ref();
-  const importModalRef = ref();
-  const drawerTitle = ref('添加文章');
-  const roleData = ref([]);
-  const exportBtn = ref(false);
-
-  let messageReactive: any = null;
-
-  const params = reactive({
-    title: '',
-  });
-
-  const actionColumn: BasicColumn = reactive({
-    width: 150,
-    title: '操作',
-    prop: 'action',
-    fixed: 'right',
-    align: 'center',
-    render(record) {
-      return h(TableAction as any, {
-        actions: [
-          {
-            label: '删除',
-            isConfirm: true,
-            popConfirm: {
-              onConfirm: handleDelete.bind(null, record.row),
-              title: '您确定要删除吗?',
-              confirmButtonText: '确定',
-              cancelButtonText: '取消',
-            },
-          },
-          {
-            label: '编辑',
-            onClick: handleEdit.bind(null, record.row),
-          },
-        ],
-      });
-    },
-  });
-
-  const loadDataTable = async (res) => {
-    const result = await articleList({ ...params, ...res });
-    tableData.value = result.list;
-    return result;
-  };
-
-  function handelImportArticle() {
-    importModalRef.value.showModal();
-  }
-
-  function removeMessage() {
-    if (messageReactive) {
-      messageReactive.close();
-      messageReactive = null;
-    }
-  }
-
-  function handelExportArticle() {
-    exportBtn.value = true;
-    messageReactive = ElLoading.service({ text: '系统正在导出,请稍等' });
-    exportArticle()
-      .then((res) => {
-        try {
-          if (res.status === 200 && res.data) {
-            downloadFile(res);
-            removeMessage();
-            message.success('导出成功');
-          }
-        } catch {
-          removeMessage();
-          message.error('系统异常,导出失败');
-        }
-        exportBtn.value = false;
-      })
-      .catch(() => {
-        exportBtn.value = false;
-      });
-  }
-
-  function onCheckedRow(keys) {
-    rowKeys.value = keys;
-    rowKeysName.value = tableData.value
-      .filter((item) => {
-        return keys.includes(item.id);
-      })
-      .map((item) => {
-        return item.username;
-      })
-      .join(',');
-  }
-
-  function reloadTable() {
-    basicTableRef.value.reload();
-  }
-
-  function openCreateDrawer() {
-    const { showModal } = createModalRef.value;
-    showModal();
-  }
-
-  function handleEdit(record) {
-    const { showModal } = createModalRef.value;
-    showModal(record.id);
-  }
-
-  function handleDelete(record: Recordable) {
-    deleteArticle({ articleId: record.id }).then(() => {
-      message.success('删除成功');
-      reloadTable();
-    });
-  }
-</script>

+ 0 - 6
src/views/article/types/index.ts

@@ -1,6 +0,0 @@
-export interface formParamsType {
-  id?: number | null;
-  content: string;
-  title: string;
-  publicTime?: string | undefined;
-}

+ 0 - 64
src/views/feature/copy/copy.vue

@@ -1,64 +0,0 @@
-<template>
-  <PageWrapper title="文本复制" content="文本复制示例,用于常规订单号,编号,快速复制等场景">
-    <el-card
-      shadow="never"
-      title="基本信息"
-      class="mt-3 proCard"
-      size="small"
-      :segmented="{ content: 'hard' }"
-    >
-      <el-descriptions label-placement="left" class="py-2">
-        <el-descriptions-item>
-          <template #label>收款人姓名</template>
-          啊俊
-        </el-descriptions-item>
-        <el-descriptions-item label="收款账户">NaiveUiAdmin@qq.com</el-descriptions-item>
-        <el-descriptions-item label="付款类型">支付宝</el-descriptions-item>
-        <el-descriptions-item label="付款账户">
-          {{ account }}
-          <el-button size="small" type="primary" @click="handleAccountCopy">复制</el-button>
-        </el-descriptions-item>
-        <el-descriptions-item label="转账金额">
-          <el-space>
-            <el-input v-model="money" placeholder="多少都是意" />
-            <el-button type="primary" @click="handleMoneyCopy">复制</el-button>
-          </el-space>
-        </el-descriptions-item>
-        <el-descriptions-item label="状态">
-          <el-tag type="success"> 已到账</el-tag>
-        </el-descriptions-item>
-      </el-descriptions>
-    </el-card>
-  </PageWrapper>
-</template>
-
-<script lang="ts" setup>
-  import { ref, unref } from 'vue';
-  import { useCopyToClipboard } from '@/hooks/web/useCopyToClipboard';
-  import { ElMessage } from 'element-plus';
-
-  const { clipboardRef, copiedRef } = useCopyToClipboard();
-
-  const account = ref('NaiveUiAdmin@163.com');
-  const money = ref(null);
-
-  function handleAccountCopy() {
-    const value = unref(account.value);
-    clipboardRef.value = value;
-    if (unref(copiedRef)) {
-      ElMessage.success(`拷贝成功:${value}`);
-    }
-  }
-
-  function handleMoneyCopy() {
-    const value = unref(money.value);
-    if (!value) {
-      ElMessage.warning('请输入要复制的内容!');
-      return;
-    }
-    clipboardRef.value = value;
-    if (unref(copiedRef)) {
-      ElMessage.success(`拷贝成功:${value}`);
-    }
-  }
-</script>

+ 0 - 56
src/views/feature/download/download.vue

@@ -1,56 +0,0 @@
-<template>
-  <PageWrapper title="文件下载" content="文件下载示例,用于各种场景下载文件或者图片">
-    <el-card shadow="never" class="mt-3 proCard">
-      <el-alert :show-icon="false" title="后台接口文件流下载" type="info">
-        <el-button class="mt-2" type="primary" @click="downloadFile">文件流下载</el-button>
-      </el-alert>
-      <el-divider />
-      <el-alert :show-icon="false" title="文件地址下载" type="info">
-        <el-button class="mt-2" type="primary" @click="downloadFileUrl">文件地址下载</el-button>
-      </el-alert>
-      <el-divider />
-      <el-alert :show-icon="false" title="base64流下载" type="info">
-        <el-button class="mt-2" type="primary" @click="downloadFileBase64">base64流下载</el-button>
-      </el-alert>
-      <el-divider />
-      <el-alert
-        :show-icon="false"
-        title="图片Url下载,如果有跨域问题,需要先处理图片跨域,才能下载"
-        type="info"
-      >
-        <el-button class="mt-2" type="primary" @click="downloadFileImgUrl">图片Url下载</el-button>
-      </el-alert>
-    </el-card>
-  </PageWrapper>
-</template>
-
-<script lang="ts" setup>
-  import {
-    downloadByUrl,
-    downloadByData,
-    downloadByBase64,
-    downloadByOnlineUrl,
-  } from '@/utils/file/download';
-  import imgBase64 from './imgBase64';
-
-  const getName = new Date().valueOf();
-
-  function downloadFile() {
-    downloadByData('测试下载文件流', `${getName}-file.txt`);
-  }
-
-  function downloadFileUrl() {
-    downloadByUrl({
-      url: 'https://naive-ui-admin-docs.vercel.app/logo.png',
-      target: '_self',
-    });
-  }
-
-  function downloadFileBase64() {
-    downloadByBase64(imgBase64, `${getName}.png`);
-  }
-
-  function downloadFileImgUrl() {
-    downloadByOnlineUrl('https://naive-ui-admin-docs.vercel.app/logo.png', `${getName}.png`);
-  }
-</script>

File diff suppressed because it is too large
+ 0 - 1
src/views/feature/download/imgBase64.ts


+ 0 - 205
src/views/feature/excel/choiceExport.vue

@@ -1,205 +0,0 @@
-<template>
-  <PageWrapper title="导出示例" content="可以选择导出格式">
-    <el-card :bordered="false" class="mt-3 proCard">
-      <BasicTable
-        title="表格列表"
-        titleTooltip="这是一个提示"
-        :columns="columns"
-        :request="loadDataTable"
-        :row-key="(row) => row.id"
-        ref="tableRef"
-        :actionColumn="actionColumn"
-        @checked-row-change="onCheckedRow"
-      >
-        <template #toolbar>
-          <el-button type="primary" @click="openModal">导出数据</el-button>
-        </template>
-      </BasicTable>
-    </el-card>
-
-    <basicModal @register="modalRegister" ref="modalRef" @ok="okModal">
-      <template #default>
-        <BasicForm
-          @register="register"
-          @submit="handleSubmit"
-          @reset="handleReset"
-          class="basicForm"
-        />
-      </template>
-    </basicModal>
-  </PageWrapper>
-</template>
-
-<script lang="ts" setup>
-  import { reactive, unref, ref, h } from 'vue';
-  import { BasicTable, TableAction } from '@/components/Table';
-  import { basicModal, useModal } from '@/components/Modal';
-  import { BasicForm, FormSchema, useForm } from '@/components/Form/index';
-  import { getTableList } from '@/api/table/list';
-  import { columns } from '../../comp/table/basicColumns';
-  import { jsonToSheetXlsx } from '@/components/Excel';
-  import { ElMessageBox, ElMessage } from 'element-plus';
-
-  const schemas: FormSchema[] = [
-    {
-      field: 'filename',
-      component: 'Input',
-      label: '文件名',
-      labelMessage: '导出的文件以该名称命名',
-      componentProps: {
-        placeholder: '请输入文件名称',
-        onInput: (e: any) => {
-          console.log(e);
-        },
-      },
-      rules: [{ required: true, message: '请输入导出的文件名称', trigger: ['blur'] }],
-    },
-    {
-      field: 'bookType',
-      component: 'Select',
-      label: '文件类型',
-      componentProps: {
-        placeholder: '请选择文件类型',
-        options: [
-          {
-            label: 'xlsx',
-            value: 'xlsx',
-          },
-          {
-            label: 'html',
-            value: 'html',
-          },
-          {
-            label: 'csv',
-            value: 'csv',
-          },
-          {
-            label: 'txt',
-            value: 'txt',
-          },
-        ],
-        onChange: (e: any) => {
-          console.log(e);
-        },
-      },
-      rules: [{ required: true, message: '请选择文件类型', trigger: ['change'] }],
-    },
-  ];
-
-  const tableRef = ref();
-  const modalRef = ref();
-  const tableData = ref();
-
-  const params = reactive({
-    pageSize: 5,
-    name: 'xiaoMa',
-  });
-
-  const [modalRegister, { openModal }] = useModal({
-    title: '导出数据',
-  });
-
-  const [register, { submit }] = useForm({
-    labelWidth: 120,
-    layout: 'horizontal',
-    // submitButtonText: '提交预约',
-    showActionButtonGroup: false,
-    schemas,
-  });
-
-  const actionColumn = reactive({
-    width: 150,
-    title: '操作',
-    key: 'action',
-    fixed: 'right',
-    align: 'center',
-    render(record) {
-      return h(TableAction, {
-        style: 'button',
-        actions: createActions(record),
-      });
-    },
-  });
-
-  async function okModal() {
-    const formRes = await submit();
-    if (formRes) {
-      modalRef.value.closeModal();
-      ElMessage.success('提交成功');
-    } else {
-      ElMessage.error('验证失败,请填写完整信息');
-      modalRef.value.setSubLoading(false);
-    }
-  }
-
-  function handleReset(values: Recordable) {
-    console.log(values);
-  }
-
-  function createActions(record) {
-    return [
-      {
-        label: '删除',
-        onClick: handleDelete.bind(null, record),
-        // 根据业务控制是否显示 isShow 和 auth 是并且关系
-        ifShow: () => {
-          return true;
-        },
-        // 根据权限控制是否显示: 有权限,会显示,支持多个
-        auth: ['basic_list'],
-      },
-      {
-        label: '编辑',
-        onClick: handleEdit.bind(null, record),
-        ifShow: () => {
-          return true;
-        },
-        auth: ['basic_list'],
-      },
-    ];
-  }
-
-  const loadDataTable = async (res) => {
-    const result = await getTableList({ ...params, ...res });
-    tableData.value = result.list;
-    return result;
-  };
-
-  function onCheckedRow(rowKeys) {
-    console.log(rowKeys);
-  }
-
-  function handleDelete(record) {
-    console.log(record);
-    ElMessageBox.confirm(`您想删除${record.name}`, '提示', {
-      confirmButtonText: '确定',
-      cancelButtonText: '取消',
-      type: 'warning',
-    })
-      .then(() => {
-        ElMessage.success('删除成功');
-      })
-      .catch(() => {});
-  }
-
-  function handleEdit(record) {
-    console.log(record);
-    ElMessage.success('您点击了编辑按钮');
-  }
-
-  function handleSubmit(values: Recordable) {
-    console.log(values);
-    // 默认Object.keys(data[0])作为header
-    const { filename, bookType } = values;
-    jsonToSheetXlsx({
-      data: unref(tableData),
-      filename: `${filename.split('.').shift()}.${bookType}`,
-      write2excelOpts: {
-        bookType,
-      },
-    });
-    ElMessage.success(JSON.stringify(values));
-  }
-</script>
-
-<style lang="scss" scoped></style>

+ 0 - 139
src/views/feature/excel/jsonExport.vue

@@ -1,139 +0,0 @@
-<template>
-  <PageWrapper title="导出示例" content="根据JSON格式的数据进行导出">
-    <el-card :bordered="false" class="mt-3 proCard">
-      <BasicTable
-        title="表格列表"
-        titleTooltip="这是一个提示"
-        :columns="columns"
-        :request="loadDataTable"
-        :row-key="(row) => row.id"
-        ref="actionRef"
-        :actionColumn="actionColumn"
-        :scroll-x="1360"
-        @checked-row-change="onCheckedRow"
-      >
-        <template #toolbar>
-          <el-space>
-            <el-button type="primary" @click="customHeader">导出自定义表头</el-button>
-            <el-button type="primary" @click="defaultHeader">导出默认表头</el-button>
-          </el-space>
-        </template>
-      </BasicTable>
-    </el-card>
-  </PageWrapper>
-</template>
-
-<script lang="ts" setup>
-  import { reactive, ref, h, unref } from 'vue';
-  import { BasicTable, TableAction } from '@/components/Table';
-  import { getTableList } from '@/api/table/list';
-  import { columns } from '../../comp/table/basicColumns';
-  import { jsonToSheetXlsx } from '@/components/Excel';
-  import { ElMessageBox, ElMessage } from 'element-plus';
-
-  const actionRef = ref();
-  const tableData = ref();
-
-  const params = reactive({
-    pageSize: 5,
-    name: 'xiaoMa',
-  });
-
-  const actionColumn = reactive({
-    width: 150,
-    title: '操作',
-    key: 'action',
-    fixed: 'right',
-    align: 'center',
-    render(record) {
-      return h(TableAction, {
-        style: 'button',
-        actions: createActions(record),
-      });
-    },
-  });
-
-  function createActions(record) {
-    return [
-      {
-        label: '删除',
-        onClick: handleDelete.bind(null, record),
-        // 根据业务控制是否显示 isShow 和 auth 是并且关系
-        ifShow: () => {
-          return true;
-        },
-        // 根据权限控制是否显示: 有权限,会显示,支持多个
-        auth: ['basic_list'],
-      },
-      {
-        label: '编辑',
-        onClick: handleEdit.bind(null, record),
-        ifShow: () => {
-          return true;
-        },
-        auth: ['basic_list'],
-      },
-    ];
-  }
-
-  const loadDataTable = async (res) => {
-    const result = await getTableList({ ...params, ...res });
-    tableData.value = result.list;
-    return result;
-  };
-
-  function onCheckedRow(rowKeys) {
-    console.log(rowKeys);
-  }
-
-  function handleDelete(record) {
-    console.log(record);
-    ElMessageBox.confirm(`您想删除${record.name}`, '提示', {
-      confirmButtonText: '确定',
-      cancelButtonText: '取消',
-      type: 'warning',
-    })
-      .then(() => {
-        ElMessage.success('删除成功');
-      })
-      .catch(() => {});
-  }
-
-  function handleEdit(record) {
-    console.log(record);
-    ElMessage.success('您点击了编辑按钮');
-  }
-
-  function defaultHeader() {
-    // 默认Object.keys(data[0])作为header
-    jsonToSheetXlsx({
-      data: unref(tableData),
-      filename: '使用key作为默认表头.xlsx',
-    });
-  }
-
-  function customHeader() {
-    jsonToSheetXlsx({
-      data: unref(tableData),
-      header: {
-        id: 'ID',
-        no: '编码',
-        name: '名称',
-        avatar: '头像',
-        address: '地址',
-        beginTime: '开始日期',
-        endTime: '结束时间',
-        status: '状态',
-        date: '创建时间',
-        time: '停留时间',
-      },
-      filename: '自定义表头.xlsx',
-      json2sheetOpts: {
-        // 指定顺序
-        //header: ['id', 'no','name','avatar','address','beginTime','endTime','status','date','time'],
-      },
-    });
-  }
-</script>
-
-<style lang="scss" scoped></style>

+ 0 - 38
src/views/feature/print/print.vue

@@ -1,38 +0,0 @@
-<template>
-  <PageWrapper title="打印场景" content="json 打印表格,图片打印">
-    <el-card shadow="never" class="mt-3 proCard">
-      <el-space>
-        <el-button type="primary" @click="jsonPrint">打印表格</el-button>
-        <el-button type="primary" @click="imagePrint">打印图片</el-button>
-      </el-space>
-    </el-card>
-  </PageWrapper>
-</template>
-
-<script lang="ts" setup>
-  import printJS from 'print-js';
-
-  function jsonPrint() {
-    printJS({
-      printable: [
-        { name: '汪伟', email: '735869@gmail.com', phone: '186****5653' },
-        { name: '雷秀英', email: '235656452@gmail.com', phone: '135****6536' },
-        { name: '邹芳', email: '24586526@gmail.com', phone: '159****5869' },
-      ],
-      properties: ['name', 'email', 'phone'],
-      type: 'json',
-    });
-  }
-
-  function imagePrint() {
-    printJS({
-      printable: [
-        'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100',
-        'https://element-plus.org/images/guide.png',
-      ],
-      type: 'image',
-      header: 'Multiple Images',
-      imageStyle: 'width:100%;',
-    });
-  }
-</script>

+ 0 - 66
src/views/feature/tags/tagsAction.vue

@@ -1,66 +0,0 @@
-<template>
-  <PageWrapper
-    title="多页签"
-    content="有些时候,可能要操作多页签标题,比如页面特定交互,详情页面区分,该操作仅限于,当前打开过并且显示的标签"
-  >
-    <el-card
-      shadow="never"
-      title="多页签操作"
-      class="mt-3 proCard"
-      size="small"
-      :segmented="{ content: 'hard' }"
-    >
-      <el-space>
-        <el-button type="primary" @click="setTabsTitle">更新当前页面标题</el-button>
-        <el-button type="primary" plain @click="setTabsTitleSpecific">更新指定页面标题</el-button>
-        <el-button type="danger" @click="closeCurrent">关闭当前页</el-button>
-      </el-space>
-      <el-divider content-position="left">设置多页签状态</el-divider>
-      <el-space>
-        <el-button type="warning" @click="setTabState('undone')">设置当前页面状态未完成</el-button>
-        <el-button type="success" @click="setTabState('done')">设置当前页面状态已完成</el-button>
-      </el-space>
-    </el-card>
-  </PageWrapper>
-</template>
-
-<script lang="ts" setup>
-  import { onMounted } from 'vue';
-  import { useTabs } from '@/hooks/web/useTags';
-  import { ElMessage } from 'element-plus';
-
-  const useTagsHooks = useTabs();
-
-  function setTabsTitle() {
-    useTagsHooks.setTitle('货品详情:编码-3695');
-    ElMessage.success('设置成功');
-  }
-
-  function setTabsTitleSpecific() {
-    useTagsHooks.setTitle('指定页面标题', { name: '/list/basic-list' });
-    ElMessage.success('设置成功');
-  }
-
-  function closeCurrent() {
-    useTagsHooks.closeCurrent();
-  }
-
-  function setTabState(state: string) {
-    useTagsHooks.setTabState({
-      state,
-      dialogOptions: {
-        content: '页面尚未提交,是否关闭?',
-      },
-    });
-    const msg =
-      state === 'undone'
-        ? '设置成功,点击当前页标签关闭按钮,试试效果'
-        : '取消成功,当前页标签,可以正常关闭';
-    ElMessage.success(msg);
-  }
-
-  //如果需要每次进入页面,都自定义,需要在 onMounted 中调用
-  onMounted(() => {
-    //setTabsTitle();
-  });
-</script>