From e190b065b237f85dbcafb3e6ee0987ee06ab1d05 Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Fri, 29 Mar 2024 10:54:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=97=A0=E7=94=A8=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Panel/index.vue | 2 - src/data.ts | 335 --------------------- src/layout/components/AppHeader.vue | 4 +- src/layout/components/AppSidebar/index.vue | 8 +- src/layout/components/Logo.vue | 9 +- src/main.ts | 2 - src/permission.ts | 2 - src/settings.ts | 10 - src/views/product/bank/Detail.vue | 6 +- src/views/product/strategy/CardList.vue | 1 + 10 files changed, 11 insertions(+), 368 deletions(-) delete mode 100644 src/data.ts diff --git a/src/components/Panel/index.vue b/src/components/Panel/index.vue index 5ddf44a..7082a77 100644 --- a/src/components/Panel/index.vue +++ b/src/components/Panel/index.vue @@ -283,7 +283,6 @@ const { x, y, style } = useDraggable(container, { }, }); -console.log('最先:', route, route.path, route.query.token, param.token); if (param.token) { // 从url带进来的参数,存cookie里,其他页面直接取cookie param.token && Cookies.set('sand-token', param.token); @@ -568,7 +567,6 @@ let reload = async (fromReload?: number) => { }; // 提交 let submit = async () => { - console.log('submit:', submiting.value); if (!submiting.value) { submiting.value = true; const checkpointId = Cookies.get('sand-level') ?? ''; diff --git a/src/data.ts b/src/data.ts deleted file mode 100644 index c3bfaac..0000000 --- a/src/data.ts +++ /dev/null @@ -1,335 +0,0 @@ -import i18n from '@/i18n'; - -export function getPermsTreeData(): any[] { - const { - global: { t }, - } = i18n; - return [ - { - label: t('menu.home'), - key: 'home', - perms: ['auth'], - children: [ - { - label: t('menu.personal'), - key: 'personal', - children: [ - { - label: t('menu.personal.password'), - key: 'password:update', - perms: ['password:update'], - }, - ], - }, - { - label: t('menu.content'), - key: 'content', - children: [ - { - label: t('menu.content.article'), - key: 'article', - perms: ['article:page', 'article:list', 'channel:list', 'dict:list', 'model:list'], - children: [ - { label: t('list'), key: 'article:page' }, - { label: t('add'), key: 'article:create', perms: ['article:create'] }, - { label: t('edit'), key: 'article:update', perms: ['article:update', 'article:show'] }, - { label: t('delete'), key: 'article:delete', perms: ['article:delete'] }, - ], - }, - { - label: t('menu.content.channel'), - key: 'channel', - perms: ['channel:page', 'channel:list'], - children: [ - { label: t('list'), key: 'channel:page' }, - { label: t('add'), key: 'channel:create', perms: ['channel:create'] }, - { label: t('edit'), key: 'channel:update', perms: ['channel:update', 'channel:show'] }, - { label: t('delete'), key: 'channel:delete', perms: ['channel:delete'] }, - ], - }, - { - label: t('menu.content.blockItem'), - key: 'blockItem', - perms: ['blockItem:page', 'blockItem:list', 'block:list'], - children: [ - { label: t('list'), key: 'blockItem:page' }, - { label: t('add'), key: 'blockItem:create', perms: ['blockItem:create'] }, - { label: t('edit'), key: 'blockItem:update', perms: ['blockItem:update', 'blockItem:show'] }, - { label: t('delete'), key: 'blockItem:delete', perms: ['blockItem:delete'] }, - ], - }, - { - label: t('menu.content.attachment'), - key: 'attachment', - perms: ['attachment:page', 'attachment:list'], - children: [ - { label: t('list'), key: 'attachment:page' }, - { label: t('add'), key: 'attachment:create', perms: ['attachment:create'] }, - { label: t('edit'), key: 'attachment:update', perms: ['attachment:update', 'attachment:show'] }, - { label: t('delete'), key: 'attachment:delete', perms: ['attachment:delete'] }, - ], - }, - { - label: t('menu.content.generator'), - key: 'generator', - perms: ['generator:show', 'siteSettings:html:show', 'task:list', 'task:show', 'task:delete'], - children: [ - { label: t('generator.op.fulltext.reindexAll'), key: 'generator:fulltext:reindexAll', perms: ['generator:fulltext:reindexAll'] }, - { label: t('generator.op.fulltext.reindexSite'), key: 'generator:fulltext:reindexSite', perms: ['generator:fulltext:reindexSite'] }, - { label: t('generator.html'), key: 'generator:html', perms: ['generator:html'] }, - { label: t('site.settings.html'), key: 'siteSettings:html:update', perms: ['siteSettings:html:update', 'generator:html'] }, - ], - }, - ], - }, - { - label: t('menu.config'), - key: 'config', - children: [ - { - label: t('menu.config.globalSettings'), - key: 'globalSettings', - perms: ['globalSettings:show'], - children: [ - { label: t('global.settings.base'), key: 'globalSettings:base:update', perms: ['globalSettings:base:update'] }, - { label: t('global.settings.upload'), key: 'globalSettings:upload:update', perms: ['globalSettings:upload:update'] }, - { label: t('global.settings.customs'), key: 'globalSettings:customs:update', perms: ['globalSettings:customs:update'] }, - ], - }, - { - label: t('menu.config.siteSettings'), - key: 'siteSettings', - perms: ['siteSettings:show'], - children: [ - { label: t('site.settings.base'), key: 'siteSettings:base:update', perms: ['siteSettings:base:update'] }, - { label: t('site.settings.watermark'), key: 'siteSettings:watermark:update', perms: ['siteSettings:watermark:update'] }, - { label: t('site.settings.customs'), key: 'siteSettings:customs:update', perms: ['siteSettings:customs:update'] }, - ], - }, - { - label: t('menu.config.model'), - key: 'model', - perms: ['model:page', 'model:list'], - children: [ - { label: t('list'), key: 'model:page' }, - { label: t('add'), key: 'model:create', perms: ['model:create'] }, - { label: t('edit'), key: 'model:update', perms: ['model:update', 'model:show'] }, - { label: t('delete'), key: 'model:delete', perms: ['model:delete'] }, - ], - }, - { - label: t('menu.config.block'), - key: 'block', - perms: ['block:page', 'block:list'], - children: [ - { label: t('list'), key: 'block:page' }, - { label: t('add'), key: 'block:create', perms: ['block:create'] }, - { label: t('edit'), key: 'block:update', perms: ['block:update', 'block:show'] }, - { label: t('delete'), key: 'block:delete', perms: ['block:delete'] }, - ], - }, - { - label: t('menu.config.dictType'), - key: 'dictType', - perms: ['dictType:page', 'dictType:list'], - children: [ - { label: t('list'), key: 'dictType:page' }, - { label: t('add'), key: 'dictType:create', perms: ['dictType:create'] }, - { label: t('edit'), key: 'dictType:update', perms: ['dictType:update', 'dictType:show'] }, - { label: t('delete'), key: 'dictType:delete', perms: ['dictType:delete'] }, - ], - }, - { - label: t('menu.config.dict'), - key: 'dict', - perms: ['dict:page', 'dict:list', 'dictType:list'], - children: [ - { label: t('list'), key: 'dict:page' }, - { label: t('add'), key: 'dict:create', perms: ['dict:create'] }, - { label: t('edit'), key: 'dict:update', perms: ['dict:update', 'dict:show'] }, - { label: t('delete'), key: 'dict:delete', perms: ['dict:delete'] }, - ], - }, - ], - }, - { - label: t('menu.user'), - key: 'user', - children: [ - { - label: t('menu.user.user'), - key: 'user', - perms: ['user:page', 'user:list', 'group:list', 'org:list'], - children: [ - { label: t('list'), key: 'user:page' }, - { label: t('add'), key: 'user:create', perms: ['user:create'] }, - { label: t('edit'), key: 'user:update', perms: ['user:update', 'user:show'] }, - { label: t('delete'), key: 'user:delete', perms: ['user:delete'] }, - ], - }, - { - label: t('menu.user.role'), - key: 'role', - perms: ['role:page', 'role:list'], - children: [ - { label: t('list'), key: 'role:page' }, - { label: t('add'), key: 'role:create', perms: ['role:create'] }, - { label: t('edit'), key: 'role:update', perms: ['role:update', 'role:show'] }, - { label: t('delete'), key: 'role:delete', perms: ['role:delete'] }, - ], - }, - { - label: t('menu.user.group'), - key: 'group', - perms: ['group:page', 'group:list'], - children: [ - { label: t('list'), key: 'group:page' }, - { label: t('add'), key: 'group:create', perms: ['group:create'] }, - { label: t('edit'), key: 'group:update', perms: ['group:update', 'group:show'] }, - { label: t('delete'), key: 'group:delete', perms: ['group:delete'] }, - ], - }, - { -// label: t('menu.user.org'), - key: 'org', - perms: ['org:page', 'org:list'], - children: [ - { label: t('list'), key: 'org:page' }, - { label: t('add'), key: 'org:create', perms: ['org:create'] }, - { label: t('edit'), key: 'org:update', perms: ['org:update', 'org:show'] }, - { label: t('delete'), key: 'org:delete', perms: ['org:delete'] }, - ], - }, - ], - }, - { - label: t('menu.system'), - key: 'system', - children: [ - { -// label: t('menu.system.site'), - key: 'site', - perms: ['site:page', 'site:list', 'org:list', 'model:list', 'storage:list'], - children: [ - { label: t('list'), key: 'site:page' }, - { label: t('add'), key: 'site:create', perms: ['site:create'] }, - { label: t('edit'), key: 'site:update', perms: ['site:update', 'site:show'] }, - { label: t('delete'), key: 'site:delete', perms: ['site:delete'] }, - ], - }, - { - label: t('menu.system.storage'), - key: 'storage', - perms: ['storage:page', 'storage:list'], - children: [ - { label: t('list'), key: 'storage:page' }, - { label: t('add'), key: 'storage:create', perms: ['storage:create'] }, - { label: t('edit'), key: 'storage:update', perms: ['storage:update', 'storage:show'] }, - { label: t('delete'), key: 'storage:delete', perms: ['storage:delete'] }, - ], - }, - // { - // label: t('menu.system.task'), - // key: 'task', - // perms: ['task:page', 'task:list'], - // children: [ - // { label: t('list'), key: 'task:page' }, - // { label: t('add'), key: 'task:create', perms: ['task:create'] }, - // { label: t('edit'), key: 'task:update', perms: ['task:update', 'task:show'] }, - // { label: t('delete'), key: 'task:delete', perms: ['task:delete'] }, - // ], - // }, - ], - }, - ], - }, - ]; -} - -export function getModelData(): any { - return { - article: { - mains: [ - { code: 'title', must: true, show: true, double: false, required: true }, - { code: 'subtitle', must: false, show: false, double: false, required: false }, - { code: 'fullTitle', must: false, show: false, double: false, required: false }, - { code: 'linkUrl', must: false, show: true, double: false, required: false }, - { code: 'seoKeywords', must: false, show: false, double: false, required: false }, - { code: 'seoDescription', must: false, show: true, double: false, required: false }, - { code: 'author', must: false, show: false, double: true, required: false }, - { code: 'editor', must: false, show: false, double: true, required: false }, - { code: 'image', must: false, show: true, double: false, required: false, type: 'image', imageWidth: 300, imageHeight: 200, imageMode: 'manual' }, - { code: 'file', must: false, show: false, double: false, required: false }, - { code: 'video', must: false, show: false, double: false, required: false }, - { code: 'doc', must: false, show: false, double: false, required: false }, - { code: 'imageList', must: false, show: false, double: false, required: false, type: 'imageList', imageMaxWidth: 1920, imageMaxHeight: 1920 }, - { code: 'fileList', must: false, show: false, double: false, required: false }, - { code: 'text', must: false, show: true, double: false, required: true }, - ], - asides: [ - { code: 'channel', must: true, show: true, required: true }, - { code: 'org', must: false, show: true, required: true }, - { code: 'publishDate', must: true, show: true, required: true }, - // { code: 'offlineDate', must: false, show: true, required: false }, - { code: 'source', must: false, show: true, required: false }, - { code: 'articleTemplate', must: false, show: true, required: false }, - { code: 'allowComment', must: false, show: true, required: true }, - { code: 'user', must: false, show: false, required: true }, - { code: 'created', must: false, show: false, required: true }, - { code: 'modifiedUser', must: false, show: false, required: false }, - { code: 'modified', must: false, show: false, required: false }, - ], - }, - channel: { - mains: [ - { code: 'name', must: true, show: true, double: true, required: true }, - { code: 'alias', must: true, show: true, double: true, required: true }, - { code: 'linkUrl', must: true, show: true, double: false, required: true }, - { code: 'seoTitle', must: false, show: true, double: true, required: false }, - { code: 'seoKeywords', must: false, show: true, double: true, required: false }, - { code: 'seoDescription', must: false, show: true, double: false, required: false }, - { code: 'channelTemplate', must: false, show: true, double: true, required: true }, - { code: 'articleTemplate', must: false, show: true, double: true, required: true }, - { code: 'channelModel', must: true, show: true, double: true, required: true }, - { code: 'articleModel', must: true, show: true, double: true, required: true }, - { code: 'group', must: false, show: true, double: false, required: true }, - { code: 'nav', must: false, show: true, double: true, required: true }, - { code: 'allowComment', must: false, show: true, double: true, required: true }, - { code: 'allowContribute', must: false, show: true, double: true, required: true }, - { code: 'allowSearch', must: false, show: true, double: true, required: true }, - { code: 'text', must: false, show: false, double: false, required: false }, - ], - asides: [ - { code: 'type', must: true, show: true, required: true }, - { code: 'parent', must: true, show: true, required: false }, - { code: 'pageSize', must: true, show: true, required: true }, - ], - }, - }; -} - -export function mergeModelFields(defaultFields: any[], s: string | null | undefined, type: string): any[] { - const fields = JSON.parse(s || '[]'); - const defaults = defaultFields.map((item: any) => ({ ...item, label: `${type}.${item.code}` })); - // 去除默认字段中不存在的字段 - fields.filter((field: any) => defaults.findIndex((item) => item.code === field.code) !== -1); - defaults.forEach((item) => { - const index = fields.findIndex((it: any) => it.code === item.code); - if (index !== -1) { - // 加上缺失属性,覆盖不可改属性 - fields[index] = { ...item, ...fields[index], must: item.must, label: item.label, type: item.type }; - } else { - // 加上没有的字段 - fields.push(item); - } - }); - return fields; -} - -export function arr2obj(arr: any[]) { - const obj: Record = {}; - arr.forEach((item: any) => { - obj[item.code] = item; - }); - return obj; -} diff --git a/src/layout/components/AppHeader.vue b/src/layout/components/AppHeader.vue index f418260..3f871b9 100644 --- a/src/layout/components/AppHeader.vue +++ b/src/layout/components/AppHeader.vue @@ -1,6 +1,6 @@ @@ -14,12 +13,6 @@ import Settings from '@/settings'; export default defineComponent({ name: 'SidebarLogo', - props: { - collapse: { - type: Boolean, - required: true, - }, - }, data() { return { title: Settings.title, diff --git a/src/main.ts b/src/main.ts index f3da37a..84965e8 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,6 +1,5 @@ import { createApp } from 'vue'; import ElementPlus from 'element-plus'; -// import Panel from '@/components/Panel/index.vue'; import App from './App.vue'; import router from './router'; import i18n from './i18n'; @@ -15,5 +14,4 @@ const app = createApp(App) // tinymce 对话框的层级太低,必须调低 ElementPlus 的 对话框层级(默认为2000) .use(ElementPlus, { zIndex: 500 }) .use(i18n); -// app.component('Panel', Panel); app.mount('#app'); diff --git a/src/permission.ts b/src/permission.ts index c9bc718..d0b1920 100644 --- a/src/permission.ts +++ b/src/permission.ts @@ -7,8 +7,6 @@ import router from './router'; NProgress.configure({ showSpinner: false }); // NProgress Configuration -const LOGIN_PATH = '/login'; - router.beforeEach(async (to: RouteLocationNormalized) => { NProgress.start(); return true; diff --git a/src/settings.ts b/src/settings.ts index 8e19ffe..747b51e 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -1,15 +1,5 @@ export default { title: import.meta.env.VITE_APP_TITLE || '金融产品设计及数字化营销沙盘', - showSettings: true, - /** - * @type {object} - * @description 各个角色的id - */ - roleIds: { - 41: '产品经理', - 42: '风控经理', - 43: '专家委员会', - }, /** * @type {array} * @description 不显示左侧菜单的路由 diff --git a/src/views/product/bank/Detail.vue b/src/views/product/bank/Detail.vue index 26e55bd..f988536 100644 --- a/src/views/product/bank/Detail.vue +++ b/src/views/product/bank/Detail.vue @@ -4,7 +4,7 @@
- +
@@ -17,10 +17,6 @@ import Info from './Info.vue'; const curTab = ref('tab1'); const status = ref('产品详情'); - -const updateStatus = (val: string) => { - status.value = val; -};