Commit 68ef6584 authored by 罗超's avatar 罗超

新增接口访问封装

新增插件市场页面
新增用户登录机制
parent 26a01a92
......@@ -2,57 +2,57 @@
module.exports = {
extends: [
'stylelint-config-standard',
'stylelint-config-html/html',
'stylelint-config-html/vue',
// 'stylelint-config-standard',
// 'stylelint-config-html/html',
// 'stylelint-config-html/vue',
],
rules: {
'indentation': 2,
'max-nesting-depth': 5,
'string-no-newline': true,
'string-quotes': 'single',
'color-hex-case': 'lower',
'color-hex-length': 'short',
'color-no-invalid-hex': true,
'font-weight-notation': 'numeric',
'function-calc-no-unspaced-operator': true,
'function-url-quotes': 'never',
'block-no-empty': true,
'no-eol-whitespace': true,
'block-opening-brace-newline-after': 'always',
'block-opening-brace-space-before': 'always',
'declaration-block-no-duplicate-properties': [true, {
ignoreProperties: ['overflow'],
}],
'declaration-block-semicolon-newline-after': 'always',
'declaration-block-trailing-semicolon': 'always',
'selector-pseudo-element-colon-notation': 'double',
'declaration-block-no-redundant-longhand-properties': [true, {
ignoreShorthands: ['inset'],
}],
'alpha-value-notation': 'number',
// 'indentation': 2,
// 'max-nesting-depth': 5,
// 'string-no-newline': true,
// 'string-quotes': 'single',
// 'color-hex-case': 'lower',
// 'color-hex-length': 'short',
// 'color-no-invalid-hex': true,
// 'font-weight-notation': 'numeric',
// 'function-calc-no-unspaced-operator': true,
// 'function-url-quotes': 'never',
// 'block-no-empty': true,
// 'no-eol-whitespace': true,
// 'block-opening-brace-newline-after': 'always',
// 'block-opening-brace-space-before': 'always',
// 'declaration-block-no-duplicate-properties': [true, {
// ignoreProperties: ['overflow'],
// }],
// 'declaration-block-semicolon-newline-after': 'always',
// 'declaration-block-trailing-semicolon': 'always',
// 'selector-pseudo-element-colon-notation': 'double',
// 'declaration-block-no-redundant-longhand-properties': [true, {
// ignoreShorthands: ['inset'],
// }],
// 'alpha-value-notation': 'number',
'max-empty-lines': null,
'no-missing-end-of-source-newline': null,
'no-descending-specificity': null,
'at-rule-empty-line-before': null,
'at-rule-no-unknown': null,
'rule-empty-line-before': null,
'number-leading-zero': null,
'selector-pseudo-element-no-unknown': null,
'selector-list-comma-newline-after': null,
'no-invalid-double-slash-comments': null,
'color-function-notation': null,
'font-family-no-missing-generic-family-keyword': null,
'selector-class-pattern': null,
'custom-property-pattern': null,
'keyframes-name-pattern': null,
'shorthand-property-no-redundant-values': null,
// 'max-empty-lines': null,
// 'no-missing-end-of-source-newline': null,
// 'no-descending-specificity': null,
// 'at-rule-empty-line-before': null,
// 'at-rule-no-unknown': null,
// 'rule-empty-line-before': null,
// 'number-leading-zero': null,
// 'selector-pseudo-element-no-unknown': null,
// 'selector-list-comma-newline-after': null,
// 'no-invalid-double-slash-comments': null,
// 'color-function-notation': null,
// 'font-family-no-missing-generic-family-keyword': null,
// 'selector-class-pattern': null,
// 'custom-property-pattern': null,
// 'keyframes-name-pattern': null,
// 'shorthand-property-no-redundant-values': null,
},
overrides: [
{
files: ['*.scss', '**/*.scss'],
customSyntax: 'postcss-scss'
},
// {
// files: ['*.scss', '**/*.scss'],
// customSyntax: 'postcss-scss'
// },
],
}
\ No newline at end of file
/* eslint-disable */
/* prettier-ignore */
// @ts-nocheck
// noinspection JSUnusedGlobalSymbols
// Generated by unplugin-auto-import
export {}
declare global {
}
/* eslint-disable */
/* prettier-ignore */
// @ts-nocheck
// Generated by unplugin-vue-components
// Read more: https://github.com/vuejs/core/pull/3399
export {}
declare module 'vue' {
export interface GlobalComponents {
Alpha: typeof import('./src/components/ColorPicker/Alpha.vue')['default']
Button: typeof import('./src/components/Button.vue')['default']
ButtonGroup: typeof import('./src/components/ButtonGroup.vue')['default']
Checkboard: typeof import('./src/components/ColorPicker/Checkboard.vue')['default']
Checkbox: typeof import('./src/components/Checkbox.vue')['default']
CheckboxButton: typeof import('./src/components/CheckboxButton.vue')['default']
ColorPicker: typeof import('./src/components/ColorPicker/index.vue')['default']
Contextmenu: typeof import('./src/components/Contextmenu/index.vue')['default']
Divider: typeof import('./src/components/Divider.vue')['default']
Drawer: typeof import('./src/components/Drawer.vue')['default']
EditableInput: typeof import('./src/components/ColorPicker/EditableInput.vue')['default']
ElButton: typeof import('element-plus/es')['ElButton']
ElCheckTag: typeof import('element-plus/es')['ElCheckTag']
ElCol: typeof import('element-plus/es')['ElCol']
ElDivider: typeof import('element-plus/es')['ElDivider']
ElInput: typeof import('element-plus/es')['ElInput']
ElRow: typeof import('element-plus/es')['ElRow']
FileInput: typeof import('./src/components/FileInput.vue')['default']
FormulaContent: typeof import('./src/components/LaTeXEditor/FormulaContent.vue')['default']
FullscreenSpin: typeof import('./src/components/FullscreenSpin.vue')['default']
Hue: typeof import('./src/components/ColorPicker/Hue.vue')['default']
Input: typeof import('./src/components/Input.vue')['default']
LaTeXEditor: typeof import('./src/components/LaTeXEditor/index.vue')['default']
MenuContent: typeof import('./src/components/Contextmenu/MenuContent.vue')['default']
Message: typeof import('./src/components/Message.vue')['default']
Modal: typeof import('./src/components/Modal.vue')['default']
MoveablePanel: typeof import('./src/components/MoveablePanel.vue')['default']
NumberInput: typeof import('./src/components/NumberInput.vue')['default']
Popover: typeof import('./src/components/Popover.vue')['default']
PopoverMenuItem: typeof import('./src/components/PopoverMenuItem.vue')['default']
RadioButton: typeof import('./src/components/RadioButton.vue')['default']
RadioGroup: typeof import('./src/components/RadioGroup.vue')['default']
Saturation: typeof import('./src/components/ColorPicker/Saturation.vue')['default']
Select: typeof import('./src/components/Select.vue')['default']
SelectGroup: typeof import('./src/components/SelectGroup.vue')['default']
Slider: typeof import('./src/components/Slider.vue')['default']
Switch: typeof import('./src/components/Switch.vue')['default']
SymbolContent: typeof import('./src/components/LaTeXEditor/SymbolContent.vue')['default']
Tabs: typeof import('./src/components/Tabs.vue')['default']
TextArea: typeof import('./src/components/TextArea.vue')['default']
WritingBoard: typeof import('./src/components/WritingBoard.vue')['default']
}
}
This diff is collapsed.
......@@ -9,17 +9,21 @@
"build:fonts": "node scripts/build-fonts"
},
"dependencies": {
"@element-plus/icons-vue": "^2.1.0",
"@icon-park/vue-next": "^1.4.2",
"animate.css": "^4.1.1",
"axios": "^1.6.2",
"chartist": "^1.3.0",
"clipboard": "^2.0.11",
"core-js": "^3.8.3",
"crypto-js": "^4.0.0",
"dexie": "3.0.3",
"element-plus": "^2.4.2",
"file-saver": "^2.0.5",
"hfmath": "0.0.2",
"html-to-image": "^1.11.11",
"lodash": "^4.17.21",
"md5-ts": "^0.1.6",
"mitt": "^3.0.1",
"nanoid": "^4.0.2",
"number-precision": "^1.6.0",
......@@ -63,6 +67,7 @@
"@vue/cli-service": "~5.0.0",
"@vue/compiler-sfc": "^3.3.7",
"@vue/eslint-config-typescript": "^11.0.2",
"babel-plugin-component": "^1.1.1",
"babel-plugin-import": "^1.13.3",
"eslint": "^8.34.0",
"eslint-plugin-vue": "^9.9.0",
......@@ -75,7 +80,9 @@
"stylelint-config-html": "^1.1.0",
"stylelint-config-standard": "^34.0.0",
"stylelint-webpack-plugin": "^4.1.1",
"typescript": "~4.7.4"
"typescript": "~4.7.4",
"unplugin-auto-import": "^0.16.7",
"unplugin-vue-components": "^0.25.2"
},
"husky": {
"hooks": {
......
......@@ -5,10 +5,10 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="renderer" content="webkit">
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<meta name="description" content="基于 Vue3.x + TypeScript 的在线演示文稿(幻灯片)应用,还原了大部分 Office PowerPoint 常用功能,实现在线PPT的编辑、演示。支持导出PPT文件。" />
<meta name="keywords" content="ppt,powerpoint,office powerpoint,在线ppt,幻灯片,演示文稿,ppt在线制作,Vue3,TypeScript" />
<meta name="description" content="微途智能创作平台" />
<meta name="keywords" content="微途智能创作平台" />
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title>PPTIST - 在线演示文稿</title>
<title>微途智能创作平台</title>
<style>
.first-screen-loading {
......
<template>
<Screen v-if="screening" />
<Market v-else-if="market"></Market>
<Editor v-else-if="_isPC" />
<Mobile v-else />
</template>
......@@ -10,23 +11,33 @@ import { storeToRefs } from 'pinia'
import { useScreenStore, useMainStore, useSnapshotStore } from '@/store'
import { LOCALSTORAGE_KEY_DISCARDED_DB } from '@/configs/storage'
import { deleteDiscardedDB } from '@/utils/database'
import { isPC } from './utils/common'
import { isPC, query } from './utils/common'
import { userStore } from './store/user'
import Editor from './views/Editor/index.vue'
import Screen from './views/Screen/index.vue'
import Mobile from './views/Mobile/index.vue'
import Market from './views/Market/Index.vue'
const _isPC = isPC()
const mainStore = useMainStore()
const snapshotStore = useSnapshotStore()
const { databaseId } = storeToRefs(mainStore)
const { screening } = storeToRefs(useScreenStore())
const { screening, market } = storeToRefs(useScreenStore())
if (process.env.NODE_ENV === 'production') {
window.onbeforeunload = () => false
}
const userLoginHandler = async ()=>{
let param = query()
let userId = 1
if(param.uid) userId=parseInt(param.uid)
await userStore().setUserLoginAsync(userId)
}
userLoginHandler()
onMounted(async () => {
await deleteDiscardedDB()
snapshotStore.initSnapshotDatabase()
......
page,view,scroll-view{
box-sizing: border-box;
}
page {
font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica,
Segoe UI, Arial, Roboto, 'PingFang SC', 'miui', 'Hiragino Sans GB', 'Microsoft Yahei',
sans-serif;
}
/* .0123456789+-ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz 联络方式酒店地址月日周一二三四五六日 */
@font-face {
font-family: "alifont";src: url("//at.alicdn.com/wf/webfont/MQHUV6e56ce5/FZ2wHD6g3frR.woff2") format("woff2"),
url("//at.alicdn.com/wf/webfont/MQHUV6e56ce5/wXT52gRya21s.woff") format("woff");
font-display: swap;
}
@font-face {
font-family: "chineseAlifont";font-weight: 500;src: url("//at.alicdn.com/wf/webfont/MQHUV6e56ce5/VV2owoIrvvbI.woff2") format("woff2"),
url("//at.alicdn.com/wf/webfont/MQHUV6e56ce5/xV0pJqRVm5nb.woff") format("woff");
font-display: swap;
}
@font-face {
font-family: "adobeFont";font-weight: 500;src: url("//at.alicdn.com/wf/webfont/MQHUV6e56ce5/PbzuLcRVxcau.woff2") format("woff2"),
url("//at.alicdn.com/wf/webfont/MQHUV6e56ce5/fM6mSq6emEV5.woff") format("woff");
font-display: swap;
}
.alifont{
font-family: alifont,chineseAlifont;
}
.adobeFont{
font-family: adobeFont;
}
.chineseAlifont{
font-family: chineseAlifont;
}
.text-bolder{
font-weight: bolder;
}
.overflow-hide{
overflow: hidden;
}
::-webkit-scrollbar {
display: none;
width: 0 !important;
height: 0 !important;
-webkit-appearance: none;
background: transparent;
color: transparent;
}
.light-shadow {
box-shadow: 0px 0px 20px 0px rgba(76,87,125,0.2)!important;
}
.page{
height: 100vh;
display: flex;
flex-direction: column;
background-color: #F7F8FA;
color: #1F2429;
/* padding-top:constant(safe-area-inset-top); */
}
.bg-default{
background-color: #F7F8FA;
}
.text-secony{
color:#29d3b2;
}
.bg-secony{
background-color:#29d3b2;
}
.bg-waring{
background-color: #f89c53;
}
.text-waring{
color: #f89c53;
}
.rounded-bottom{
border-bottom-left-radius: 6px;
border-bottom-right-radius: 6px;
}
.rounded-top{
border-top-left-radius: 6px;
border-top-right-radius: 6px;
}
.column{
display: flex;
flex-direction: column;
}
.flex-between{
justify-content: space-between;
}
.text-primary{
color:#0b40fe;
}
.text-info{
color:#b1b7cf;
}
.bg-white{
background-color: #FFF;
}
.just-center{
justify-content:center;
}
.flex{
display:flex;
}
.text-center{
text-align: center;
}
.van-tabs__scroll {
background-color: transparent !important;
}
.van-tabs__line{
width:4px !important;
height: 4px !important;
border-radius: 4px !important;
/* left: 50% !important; */
/* margin-left: -2px !important; */
}
.bg-transparent{
background: transparent !important;
}
.page .context{
flex: 1;
height: 1px;
padding: 0 20px
}
.row{
display: flex;
flex-direction: row;
flex-wrap: nowrap;
}
.wrap{
flex-wrap: wrap !important;
}
.text-normal{
font-weight: 400;
}
.text-disable{
color:#E1E7FA;
}
.bg-disable{
background-color: #E1E7FA;
}
.q-horizon{
height: 1px;
width:100%;
}
.q-ml-sm{
margin-left: 5px;
}
.q-py-sm{
padding-top: 5px;
padding-bottom:5px ;
}
.items-center{
align-items: center;
}
.items-end{
align-items: flex-end;
}
.q-px-xl{
padding-left: 30px;
padding-right: 300px;
}
.display-none{
display: none;
}
.col{
min-width: 1px;
flex: 1;
min-height: 1px;
}
.text-bold{
font-weight: 600;
}
.q-pa-no{
padding: 0 !important;
}
.van-multi-ellipsis--l5 {
-webkit-line-clamp: 5;
}
.text-shadow{
text-shadow: 2px 2px 5px rgba(0,0,0,0.5);
word-break: break-all;
}
.text-white{
color:#FFF;
}
.q-absolute{
position: absolute;
left: 0;
top: 0;
}
.q-pb-md{
padding-bottom: 10px;
}
.q-relative{
position: relative;
}
.q-ma-no{
padding:0 !important
}
.q-ma-md{
margin:10px
}
.q-ml-md{
margin-left:10px;
}
.q-mx-md{
margin-right:10px;
margin-left:10px;
}
.q-mr-md{
margin-right:10px
}
.q-mt-md{
margin-top:10px
}
.q-pa-md{
padding:10px;
}
.q-mb-md{
margin-bottom:10px
}
.q-py-md{
padding-top: 10px;
padding-bottom: 10px;
}
.bg-primary{
background-color: #0b40fe;
}
.q-px-lg{
padding-left: 20px;
padding-right: 20px;
}
.q-px-md{
padding-left: 10px;
padding-right: 10px;
}
.q-pl-lg{
padding-left: 20px;
}
.q-py-lg{
padding-top: 20px;
padding-bottom: 20px;
}
.q-my-lg{
margin-top: 20px;
margin-bottom: 20px;
}
.q-mx-lg{
margin-left: 20px;
margin-right: 20px;
}
.q-my-md{
margin-top: 12px;
margin-bottom: 12px;
}
.q-pt-lg{
padding-top: 20px;
}
.q-pt-md{
padding-top: 12px;
}
.q-ma-lg{
margin:20px
}
.q-pa-lg{
padding:20px
}
.q-ml-lg{
margin-left:20px;
}
.q-mr-lg{
margin-right:20px
}
.q-mt-lg{
margin-top:20px
}
.q-mb-lg{
margin-bottom:20px
}
.rounded{
border-radius: 6px;
-webkit-border-radius: 6px;
-moz-border-radius: 6px;
-ms-border-radius: 6px;
-o-border-radius: 6px;
}
.relative{
position: relative;
}
.full-height{
height: 100%;
}
.full-width{
width:100%;
}
.text-nategive{
color: #FF4B86;
}
.text-right{
text-align: right;
}
.text-small{
font-size: 12px;
}
.text-light{
font-weight: 300;
}
\ No newline at end of file
......@@ -135,3 +135,12 @@ textarea {
::-webkit-scrollbar-thumb {
background-color: #c1c1c1;
}
:root {
--el-color-primary: #d14424;
--el-color-primary-light-3: #de6949;
--el-color-primary-light-5: #e68d79;
--el-color-primary-light-7: #f8a491;
--el-color-primary-light-8: #fdcec4;
--el-color-primary-light-9: #ffebe6;
--el-color-primary-dark-2: #d43410;
}
\ No newline at end of file
import Axios, {
AxiosResponse,
InternalAxiosRequestConfig,
AxiosError,
} from 'axios';
let datas: AxiosResponse
export enum ApiResult{
'SUCCESS' = 1,
'FAILED' = 0,
'TOKEN_INVALID' = 10000,
'TOKEN_ILLEGAL' = 10001,
}
/**
* get status code
* @param {AxiosResponse} response Axios response object
*/
const getErrorCode2text = (response: AxiosResponse): string => {
const code = response.status
let message = 'Request Error'
switch (code) {
case 400:
message = 'Request Error'
break
case 401:
message = 'Unauthorized, please login'
break
case 403:
message = '拒绝访问'
break
case 404:
message = '访问资源不存在'
break
case 408:
message = '请求超时'
break
case 500:
message = '位置错误'
break
case 501:
message = '承载服务未实现'
break
case 502:
message = '网关错误'
break
case 503:
message = '服务暂不可用'
break
case 504:
message = '网关超时'
break
case 505:
message = '暂不支持的 HTTP 版本'
break
default:
message = '位置错误'
}
return message
}
/**
* @returns {AxiosResponse} result
* @tutorial see more:https://github.com/onlyling/some-demo/tree/master/typescript-width-axios
* @example
* service.get<{data: string; code: number}>('/test').then(({data}) => { console.log(data.code) })
*/
const service = Axios.create({
baseURL: 'http://192.168.10.160/api/common/post',
timeout: 20000,
headers: {
'User-Type': 'bus',
'Content-Type': 'application/json;charset=UTF-8'
}
})
/**
* @description 请求发起前的拦截器
* @returns {AxiosRequestConfig} config
*/
service.interceptors.request.use(
async (config: InternalAxiosRequestConfig) => {
return config;
},
error => {
//TODO: 新增网络请求异常处理业务
return Promise.reject(error)
}
)
/**
* @description 响应收到后的拦截器
* @returns {}
*/
service.interceptors.response.use(
/** 请求有响应 */
async (response: AxiosResponse) => {
if (response.status === 200) {
if(response.data.resultCode == ApiResult.TOKEN_ILLEGAL || response.data.resultCode == ApiResult.TOKEN_INVALID){
}
datas = response
return Promise.resolve(datas)
} else {
const __text = getErrorCode2text(response)
return Promise.reject(new Error(__text))
}
},
/** 请求无响应 */
(error: AxiosError) => {
if (error && error.response) {
const __text = getErrorCode2text(error.response);
return Promise.reject(new Error(__text));
} else {
return Promise.reject(new Error('unknow error'));
}
}
)
export default service
......@@ -13,9 +13,14 @@ import '@/assets/styles/font.scss'
import Icon from '@/plugins/icon'
import Directive from '@/plugins/directive'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
const app = createApp(App)
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
app.component(key, component)
}
app.use(Icon)
app.use(Directive)
......
import Api,{ HttpResponse, Result } from './../utils/request';
class LineService{
static async GetLineListAsync():Promise<HttpResponse>{
return Api.Post("line_post_GetAllList",{})
}
}
export default LineService;
\ No newline at end of file
import Api,{ HttpResponse, Result } from './../utils/request';
class UserServices{
static async LoginAsync(userId:number):Promise<HttpResponse>{
let msg = {EmployeeId:userId}
return Api.Post("admin_get_GetErpLoginInfoByUid",msg)
}
}
export default UserServices;
\ No newline at end of file
import { defineStore } from 'pinia'
export interface ScreenState {
screening: boolean
screening: boolean,
market:boolean
}
export const useScreenStore = defineStore('screen', {
state: (): ScreenState => ({
screening: false, // 是否进入放映状态
market: true
}),
actions: {
setScreening(screening: boolean) {
this.screening = screening
if (screening) {
this.market = false
}
},
setMarket(market: boolean){
this.market = market
}
},
})
\ No newline at end of file
import UserService from '@/services/UserService';
import { defineStore } from 'pinia';
export const userStore = defineStore('user', {
state:()=>({
token:'' as string,
userInfo:{} as any
}),
getters: {
getUserToken: (state) => {
return state.token;
},
getUser: (state) => {
return state.userInfo;
},
},
actions:{
async setUserLoginAsync(userId:number){
try {
let response = await UserService.LoginAsync(userId)
if (response.data.resultCode == 1) {
this.token = response.data.data.token
this.userInfo = response.data.data
}
} catch (error) {}
}
}
});
\ No newline at end of file
......@@ -14,4 +14,16 @@ export const fillDigit = (digit: number, len: number) => {
*/
export const isPC = () => {
return !navigator.userAgent.match(/(iPhone|iPod|iPad|Android|Mobile|BlackBerry|Symbian|Windows Phone)/i)
}
export const query = (url?:string)=>{
url = url??location.href
let str = url.substr(url.indexOf('?') + 1)
let json = {} as any
const arr = str.split('&')
for(let i = 0; i < arr.length; i++) {
let item = arr[i].split('=')
json[item[0]] = item[1]
}
return json
}
\ No newline at end of file
import service, { ApiResult } from "../configs/axios";
import { userStore } from "@/store/user";
import md5 from "md5-ts";
export interface HttpResponse {
status: number
statusText: string
data: Result
}
export interface Result {
resultCode: ApiResult
message: string
data: any
[key: string]: any
}
class Api{
constructor(){ }
static Post = (cmd:string,msg:any): Promise<HttpResponse>=>{
let datas: any
let language = 'zh_CN'
let currencyCode = 'CNY'
datas = msg
msg = datas??{}
let token = userStore().getUserToken??''
let key = ""
let groupId = userStore().getUser?.groupId
let timestamp = (new Date()).valueOf();
var encodeMsg = encodeURIComponent(JSON.stringify(msg)).toLowerCase();
var md5Str = md5(`cmd=${cmd}&msg=${encodeMsg}&timestamp=${timestamp}&token=${token}&key=${key}`);
var postData = {
"groupId": groupId,
"msg": msg,
"cmd": cmd,
"timestamp": timestamp,
"token": token,
"sign": md5Str,
"locale": language,
"currencyCode": currencyCode
}
return service.post('', postData)
}
}
export default Api;
<template>
<div style="padding: 30px; background: #f3f6fb;height:100vh;">
<div style="max-width:1440px; margin:0 auto;">
<el-row justify="space-between">
<el-col :span="6">
<h1 class="alifont" style="font-size:20px;">智慧设计平台</h1>
</el-col>
<el-col :span="6">
<el-input v-model="searchKey" placeholder="输入模板关键字快速查找" class="input-with-select">
<template #append>
<el-button type="primary" @click="queryTemplateBySearchHandler">搜索</el-button>
</template>
</el-input>
</el-col>
<el-col :span="6"></el-col>
</el-row>
<div class="q-mt-lg bg-white q-pa-lg rounded">
<div class="row text-small items-center">
<span class="q-mr-lg">适用线路:</span>
<el-check-tag :checked="queryObj.lineId == 0" @change="onLineChangeHandler(0)"
class="text-small q-mr-md">全部</el-check-tag>
<el-check-tag :checked="queryObj.lineId == x.LineID" @change="onLineChangeHandler(x.LineID)" class="text-small q-mr-md"
v-for="x in lines" :key="x.LineID">{{x.LineName}}</el-check-tag>
</div>
<el-divider></el-divider>
</div>
</div>
</div>
</template>
<script setup lang="ts">
import { reactive, ref } from "vue";
import LineService from '@/services/LineService'
import { userStore } from "@/store/user";
import { storeToRefs } from "pinia";
const {userInfo} = storeToRefs(userStore())
const lines = ref([] as Array<any>)
const queryObj = reactive({
lineId: 0,
searchKey: ''
})
const queryTemplateBySearchHandler = () => { }
const onLineChangeHandler = (lineId: number) => {
queryObj.lineId = lineId
}
const getLinesHandler = async ()=>{
try {
let response = await LineService.GetLineListAsync()
if(response.data.resultCode==1){
lines.value= response.data.data
console.log(lines.value)
}
} catch (error) { }
}
getLinesHandler()
</script>
<style>
@import url('../../assets/styles/common.css');
@font-face {
font-family: "alifont";
font-weight: 400;
src: url("//at.alicdn.com/wf/webfont/MQHUV6e56ce5/285OveHVCHM7.woff2") format("woff2"),
url("//at.alicdn.com/wf/webfont/MQHUV6e56ce5/pz3etdXOpfWP.woff") format("woff");
font-display: swap;
}
.alifont {
font-family: alifont;
}
.el-check-tag {
background: #FFF;
font-weight: 500 !important;
font-size: 12px !important;
}</style>
......@@ -13,7 +13,8 @@
"baseUrl": ".",
"types": [
"webpack-env",
"resize-observer-browser"
"resize-observer-browser",
// "element-plus/global"
],
"paths": {
"@/*": [
......
/* eslint-disable @typescript-eslint/no-var-requires */
const StyleLintPlugin = require('stylelint-webpack-plugin')
const AutoImport = require('unplugin-auto-import/webpack')
const Components = require('unplugin-vue-components/webpack')
const { ElementPlusResolver } = require('unplugin-vue-components/resolvers')
module.exports = {
publicPath: './',
lintOnSave: false,
css: {
loaderOptions: {
sass: {
......@@ -16,11 +20,17 @@ module.exports = {
},
configureWebpack: {
plugins: [
new StyleLintPlugin({
files: ['src/**/*.{vue,html,css,scss}'],
failOnError: false,
cache: false,
fix: false,
// new StyleLintPlugin({
// files: ['src/**/*.{vue,html,css,scss}'],
// failOnError: false,
// cache: false,
// fix: false,
// }),
AutoImport({
resolvers: [ElementPlusResolver()],
}),
Components({
resolvers: [ElementPlusResolver()],
}),
],
},
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment