diff --git a/src/apis/index.js b/src/apis/index.js index 0e65669..df6dea0 100644 --- a/src/apis/index.js +++ b/src/apis/index.js @@ -3,7 +3,7 @@ import http from 'utils/axios'; const apiUrl = import.meta.env.VITE_API_URL_NEW; -const users = `${apiUrl}/gateway/tall3/v3.0/users`; +const users = `${apiUrl}/gateway/ptostall/users`; // 根据userId 获取token export const getToken = userId => http.get(`${users}/userId`, { params: { userId } }); diff --git a/src/assets/iPhone13.png b/src/assets/iPhone13.png new file mode 100644 index 0000000..e890b8e Binary files /dev/null and b/src/assets/iPhone13.png differ diff --git a/src/components/configure.vue b/src/components/configure.vue new file mode 100644 index 0000000..4315eba --- /dev/null +++ b/src/components/configure.vue @@ -0,0 +1,81 @@ + + + diff --git a/src/components/leftMenu.vue b/src/components/leftMenu.vue index 4658b8d..a1d561a 100644 --- a/src/components/leftMenu.vue +++ b/src/components/leftMenu.vue @@ -1,6 +1,6 @@ diff --git a/src/components/listTable.vue b/src/components/listTable.vue index bf090c2..5fb1f06 100644 --- a/src/components/listTable.vue +++ b/src/components/listTable.vue @@ -23,7 +23,7 @@ diff --git a/src/components/navbar.vue b/src/components/navbar.vue index 4734d2f..d94bed0 100644 --- a/src/components/navbar.vue +++ b/src/components/navbar.vue @@ -12,13 +12,13 @@ :default-active="data.activeIndex" mode="horizontal" > - {{ - list.title - }} + + {{ list.title }} +
控制台
- +
@@ -46,7 +46,7 @@ import { computed, reactive } from 'vue'; import { useStore } from 'vuex'; import { useRouter } from 'vue-router'; -import { ArrowDown } from '@element-plus/icons'; +import { ArrowDown, Bell } from '@element-plus/icons'; const store = useStore(); const router = useRouter(); diff --git a/src/components/plugin.vue b/src/components/plugin.vue index d8a091d..4a9b96a 100644 --- a/src/components/plugin.vue +++ b/src/components/plugin.vue @@ -11,7 +11,6 @@ import { computed, reactive, nextTick, defineProps } from 'vue'; import { useStore } from 'vuex'; const props = defineProps({ plugin: { default: () => {}, type: Object } }); - const store = useStore(); const token = computed(() => store.state.user.token); const userId = computed(() => store.state.user.userId); @@ -21,8 +20,17 @@ setPlugin(); // 获取插件信息 function setPlugin() { - if (!props.plugin || !props.plugin.id) return; console.log('props.plugin: ', props.plugin); + let id = ''; + if (props.plugin) { + if (props.plugin.id) { + id = props.plugin.id; + } + if (props.plugin.pluginId) { + id = props.plugin.pluginId; + } + } + if (!props.plugin || !id) return; const reg = /data-root=["|']?(\w+)["|']?/gi; let uuid = ''; // FIXME: 没有兼容 只有js, 没有html的情况 @@ -30,30 +38,31 @@ function setPlugin() { // 查有没有data-root=“xxx” 有的话 将xxx替换为 pluginTaskId if (reg.test(props.plugin.html)) { uuid = RegExp.$1; - const str = props.plugin.html.replace(new RegExp(uuid, 'g'), `p${props.plugin.id}`); + const str = props.plugin.html.replace(new RegExp(uuid, 'g'), `p${id}`); data.pluginContent = str; } else { data.pluginContent = props.plugin.html; } - const str = props.plugin.js.replace(new RegExp(uuid, 'g'), `p${props.plugin.id}`); - handleDom(str); + const str = props.plugin.js.replace(new RegExp(uuid, 'g'), `p${id}`); + handleDom(str, id); } } // 创建script dom -function handleDom(js) { +function handleDom(js, id) { const domList = Array.from(document.getElementsByTagName('script')); - const index = domList.findIndex(item => item.id === `p${props.plugin.id}`); + const index = domList.findIndex(item => item.id === `p${id}`); if (index >= 0) { - document.body.removeChild(document.getElementById(`p${props.plugin.id}`)); + document.body.removeChild(document.getElementById(`p${id}`)); } const scriptDom = document.createElement('script'); - scriptDom.id = `p${props.plugin.id}`; + scriptDom.id = `p${id}`; scriptDom.setAttribute('data-type', 'plugin'); scriptDom.innerHTML = js; - console.log('scriptDom: ', scriptDom); nextTick(() => { document.body.append(scriptDom); }); } + +// 没有id diff --git a/src/components/relevance.vue b/src/components/relevance.vue index d4ec1dc..c020bed 100644 --- a/src/components/relevance.vue +++ b/src/components/relevance.vue @@ -3,7 +3,8 @@ {{ business.name }} -
{{ isLastPage ? '到底啦~' : '加载中...' }}
+
暂无数据
+
{{ isLastPage ? '到底啦~' : '加载中...' }}
@@ -55,7 +56,7 @@ async function chooseBusiness(e) { emit('query', props.businessId); } } catch (error) { - ElMessage.error('关联失败'); + ElMessage.error(error || '关联失败'); console.error('error: ', error); } } diff --git a/src/components/searchBar.vue b/src/components/searchBar.vue index 00045d1..4135e47 100644 --- a/src/components/searchBar.vue +++ b/src/components/searchBar.vue @@ -7,8 +7,8 @@
- - 搜索 + + 搜索 创建插件
@@ -50,41 +50,42 @@ const router = useRouter(); const store = useStore(); const data = reactive({ - tags: ['交付物', '财务条', '签到打卡', '即时奖惩'], + tags: [], + // tags: ['交付物', '财务条', '签到打卡', '即时奖惩'], keywords: '', industryList: [ - { - value: '行业一', - label: '行业一', - checked: true, - }, - { - value: '行业二', - label: '行业二', - checked: false, - }, - { - value: '行业三', - label: '行业三', - checked: false, - }, + // { + // value: '行业一', + // label: '行业一', + // checked: true, + // }, + // { + // value: '行业二', + // label: '行业二', + // checked: false, + // }, + // { + // value: '行业三', + // label: '行业三', + // checked: false, + // } ], sortList: [ - { - value: '分类一', - label: '分类一', - checked: false, - }, - { - value: '分类二', - label: '分类二', - checked: true, - }, - { - value: '分类三', - label: '分类三', - checked: false, - }, + // { + // value: '分类一', + // label: '分类一', + // checked: false, + // }, + // { + // value: '分类二', + // label: '分类二', + // checked: true, + // }, + // { + // value: '分类三', + // label: '分类三', + // checked: false, + // }, ], }); diff --git a/src/routers/index.js b/src/routers/index.js index 491529b..1743ac7 100644 --- a/src/routers/index.js +++ b/src/routers/index.js @@ -3,7 +3,7 @@ import { createRouter, createWebHistory } from 'vue-router'; export const routes = [ // { - // path: '/store/overview', + // path: '/open/overview', // name: 'overview', // meta: { // title: '设备概览', @@ -15,13 +15,13 @@ export const routes = [ export const user = [ { - path: '/store/user/signin', + path: '/open/user/signin', name: 'signin', meta: {}, component: () => import('views/user/sign-in.vue'), }, { - path: '/store/user/pw-change', + path: '/open/user/pw-change', name: 'pw-change', meta: {}, component: () => import('views/user/pw-change.vue'), @@ -33,51 +33,51 @@ const router = createRouter({ routes: [ { path: '/', - redirect: '/store/user/signin', + redirect: '/open/user/signin', }, { - path: '/store', - redirect: '/store/user/signin', + path: '/open', + redirect: '/open/user/signin', }, { - path: '/store/home', + path: '/open/home', name: 'home', component: () => import('views/Index.vue'), children: [ { - path: '/store/home/plugin-shop', + path: '/open/home/plugin-shop', name: 'plugin-shop', component: () => import('views/index-list/plugin-shop.vue'), }, { - path: '/store/home/console-desk', + path: '/open/home/console-desk', name: 'console-desk', component: () => import('views/index-list/console-desk.vue'), children: [ { - path: '/store/home/console-desk/plugin-list', + path: '/open/home/console-desk/plugin-list', name: 'desk-plugin-list', component: () => import('views/index-list/plugin-list.vue'), }, { - path: '/store/home/console-desk/add-plugin', + path: '/open/home/console-desk/add-plugin', name: 'desk-add-plugin', component: () => import('views/index-list/add-plugin.vue'), }, { - path: '/store/home/console-desk/business-list', + path: '/open/home/console-desk/business-list', name: 'desk-business-list', component: () => import('views/index-list/business-list.vue'), }, { - path: '/store/home/console-desk/add-business', + path: '/open/home/console-desk/add-business', name: 'desk-add-business', component: () => import('views/index-list/add-business.vue'), }, ], }, { - path: '/store/home/business-detail', + path: '/open/home/business-detail', name: 'business-detail', component: () => import('views/index-list/business-detail.vue'), }, diff --git a/src/utils/axios.js b/src/utils/axios.js index e15e0a0..550fcd0 100644 --- a/src/utils/axios.js +++ b/src/utils/axios.js @@ -14,7 +14,7 @@ instance.interceptors.request.use( config => { const token = store.getters['user/token'] || sessionStorage.getItem('token'); if (token) { - // config.headers.Authorization = `Bearer ${token}`; + config.headers.Authorization = `Bearer ${token}`; } // config.headers.deviceId = store.state.systemInfo.deviceId; config.headers.deviceId = '1'; diff --git a/src/views/Index.vue b/src/views/Index.vue index b823069..634d265 100644 --- a/src/views/Index.vue +++ b/src/views/Index.vue @@ -14,11 +14,6 @@ diff --git a/src/views/index-list/add-business.vue b/src/views/index-list/add-business.vue index 4a906f9..414b381 100644 --- a/src/views/index-list/add-business.vue +++ b/src/views/index-list/add-business.vue @@ -12,14 +12,14 @@ - - + + - - + + @@ -27,7 +27,7 @@ - + @@ -85,19 +85,20 @@ const onSubmit = () => { params.param.debug = form.debug ? 1 : 0; await saveBusiness(params); ElMessage.success('创建成功'); + resetForm(); } else { - ElMessage.error('创建失败'); return false; } }); } catch (error) { + ElMessage.error(error || '创建失败'); console.log('error: ', error); } }; -const resetForm = () => { +function resetForm() { formRef.value.resetFields(); -}; +} const options = [ { value: 'HTML', diff --git a/src/views/index-list/add-plugin.vue b/src/views/index-list/add-plugin.vue index 8d5fffd..fcdacf1 100644 --- a/src/views/index-list/add-plugin.vue +++ b/src/views/index-list/add-plugin.vue @@ -33,7 +33,6 @@ - 预览 预览预览预览预览 @@ -44,7 +43,7 @@ - + 发布 重置 + + @@ -160,12 +166,12 @@ function onSubmit() { resetForm(); bannerUpload.value.clearFiles(); } else { - ElMessage.error('插件创建失败'); console.log('error submit!!'); return false; } }); } catch (error) { + ElMessage.error(error || '插件创建失败'); console.error('error: ', error); } } @@ -284,4 +290,20 @@ function resetForm() { width: 104px; height: 104px; } + +.plugin-box { + position: fixed; + right: 14rem; + background: url(../../assets/iPhone13.png) no-repeat; + background-size: contain; + width: 19.375rem; + height: 39.2419rem; + top: calc(50vh - 289.93512px + 1.8rem); + padding: 2.8rem 1.2rem 2rem; + z-index: 99; +} + +.plugin::-webkit-scrollbar { + display: none; +} diff --git a/src/views/index-list/business-detail.vue b/src/views/index-list/business-detail.vue index 1937df3..95ba8d5 100644 --- a/src/views/index-list/business-detail.vue +++ b/src/views/index-list/business-detail.vue @@ -25,7 +25,7 @@

已绑定插件

- +
path.join(__dirname, dir); // https://vitejs.dev/config/ export default defineConfig({ - base: '/store/', + base: '/open/', plugins: [vue(), VitePWA(), WindiCSS(), Components({ resolvers: [ElementPlusResolver()] }), viteCompression()], resolve: { alias: {