Compare commits
2 Commits
0f9f99063e
...
dec10895b1
| Author | SHA1 | Date |
|---|---|---|
|
|
dec10895b1 | |
|
|
2b92c69e75 |
|
|
@ -7,6 +7,7 @@ declare module 'vue' {
|
|||
ABadge: typeof import('ant-design-vue/es')['Badge']
|
||||
AButton: typeof import('ant-design-vue/es')['Button']
|
||||
ACard: typeof import('ant-design-vue/es')['Card']
|
||||
ACheckbox: typeof import('ant-design-vue/es')['Checkbox']
|
||||
ACol: typeof import('ant-design-vue/es')['Col']
|
||||
ADropdown: typeof import('ant-design-vue/es')['Dropdown']
|
||||
AEmpty: typeof import('ant-design-vue/es')['Empty']
|
||||
|
|
@ -26,6 +27,11 @@ declare module 'vue' {
|
|||
ASwitch: typeof import('ant-design-vue/es')['Switch']
|
||||
ATextarea: typeof import('ant-design-vue/es')['Textarea']
|
||||
ATooltip: typeof import('ant-design-vue/es')['Tooltip']
|
||||
ElButton: typeof import('element-plus/es')['ElButton']
|
||||
ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
|
||||
ElForm: typeof import('element-plus/es')['ElForm']
|
||||
ElFormItem: typeof import('element-plus/es')['ElFormItem']
|
||||
ElInput: typeof import('element-plus/es')['ElInput']
|
||||
ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
|
||||
Empty: typeof import('./src/components/empty/Empty.vue')['default']
|
||||
ImageCropper: typeof import('./src/components/image-cropper/index.vue')['default']
|
||||
|
|
|
|||
|
|
@ -12,17 +12,17 @@
|
|||
export default {
|
||||
props: {
|
||||
image: {
|
||||
type: String,
|
||||
type: String
|
||||
},
|
||||
icon: {
|
||||
type: String,
|
||||
default: 'el-icon-tickets',
|
||||
default: 'el-icon-tickets'
|
||||
},
|
||||
description: {
|
||||
type: String,
|
||||
default: '暂无数据',
|
||||
},
|
||||
},
|
||||
default: '暂无数据'
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -14,6 +14,6 @@ export default function (data, mime) {
|
|||
}
|
||||
// canvas.toDataURL 返回的默认格式就是 image/png
|
||||
return new Blob([ia], {
|
||||
type: mime,
|
||||
type: mime
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ export default function (e, argOpts) {
|
|||
{
|
||||
ele: e.target, // 波纹作用元素
|
||||
type: 'hit', // hit点击位置扩散center中心点扩展
|
||||
bgc: 'rgba(0, 0, 0, 0.15)', // 波纹颜色
|
||||
bgc: 'rgba(0, 0, 0, 0.15)' // 波纹颜色
|
||||
},
|
||||
argOpts
|
||||
)
|
||||
|
|
|
|||
|
|
@ -10,13 +10,13 @@ export default {
|
|||
off: '取消',
|
||||
close: '关闭',
|
||||
back: '上一步',
|
||||
save: '保存',
|
||||
save: '保存'
|
||||
},
|
||||
error: {
|
||||
onlyImg: '仅限图片格式',
|
||||
outOfSize: '单文件大小不能超过 ',
|
||||
lowestPx: '图片最低像素为(宽*高):',
|
||||
},
|
||||
lowestPx: '图片最低像素为(宽*高):'
|
||||
}
|
||||
},
|
||||
'zh-tw': {
|
||||
hint: '點擊,或拖動圖片至此處',
|
||||
|
|
@ -29,13 +29,13 @@ export default {
|
|||
off: '取消',
|
||||
close: '關閉',
|
||||
back: '上一步',
|
||||
save: '保存',
|
||||
save: '保存'
|
||||
},
|
||||
error: {
|
||||
onlyImg: '僅限圖片格式',
|
||||
outOfSize: '單文件大小不能超過 ',
|
||||
lowestPx: '圖片最低像素為(寬*高):',
|
||||
},
|
||||
lowestPx: '圖片最低像素為(寬*高):'
|
||||
}
|
||||
},
|
||||
en: {
|
||||
hint: 'Click or drag the file here to upload',
|
||||
|
|
@ -48,13 +48,13 @@ export default {
|
|||
off: 'Cancel',
|
||||
close: 'Close',
|
||||
back: 'Back',
|
||||
save: 'Save',
|
||||
save: 'Save'
|
||||
},
|
||||
error: {
|
||||
onlyImg: 'Image only',
|
||||
outOfSize: 'Image exceeds size limit: ',
|
||||
lowestPx: "Image's size is too low. Expected at least: ",
|
||||
},
|
||||
lowestPx: "Image's size is too low. Expected at least: "
|
||||
}
|
||||
},
|
||||
ro: {
|
||||
hint: 'Atinge sau trage fișierul aici',
|
||||
|
|
@ -68,14 +68,14 @@ export default {
|
|||
off: 'Anulează',
|
||||
close: 'Închide',
|
||||
back: 'Înapoi',
|
||||
save: 'Salvează',
|
||||
save: 'Salvează'
|
||||
},
|
||||
|
||||
error: {
|
||||
onlyImg: 'Doar imagini',
|
||||
outOfSize: 'Imaginea depășește limita de: ',
|
||||
loewstPx: 'Imaginea este prea mică; Minim: ',
|
||||
},
|
||||
loewstPx: 'Imaginea este prea mică; Minim: '
|
||||
}
|
||||
},
|
||||
ru: {
|
||||
hint: 'Нажмите, или перетащите файл в это окно',
|
||||
|
|
@ -88,13 +88,13 @@ export default {
|
|||
off: 'Отменить',
|
||||
close: 'Закрыть',
|
||||
back: 'Назад',
|
||||
save: 'Сохранить',
|
||||
save: 'Сохранить'
|
||||
},
|
||||
error: {
|
||||
onlyImg: 'Только изображения',
|
||||
outOfSize: 'Изображение превышает предельный размер: ',
|
||||
lowestPx: 'Минимальный размер изображения: ',
|
||||
},
|
||||
lowestPx: 'Минимальный размер изображения: '
|
||||
}
|
||||
},
|
||||
'pt-br': {
|
||||
hint: 'Clique ou arraste o arquivo aqui para carregar',
|
||||
|
|
@ -107,13 +107,13 @@ export default {
|
|||
off: 'Cancelar',
|
||||
close: 'Fechar',
|
||||
back: 'Voltar',
|
||||
save: 'Salvar',
|
||||
save: 'Salvar'
|
||||
},
|
||||
error: {
|
||||
onlyImg: 'Apenas imagens',
|
||||
outOfSize: 'A imagem excede o limite de tamanho: ',
|
||||
lowestPx: 'O tamanho da imagem é muito pequeno. Tamanho mínimo: ',
|
||||
},
|
||||
lowestPx: 'O tamanho da imagem é muito pequeno. Tamanho mínimo: '
|
||||
}
|
||||
},
|
||||
fr: {
|
||||
hint: 'Cliquez ou glissez le fichier ici.',
|
||||
|
|
@ -126,13 +126,13 @@ export default {
|
|||
off: 'Annuler',
|
||||
close: 'Fermer',
|
||||
back: 'Retour',
|
||||
save: 'Enregistrer',
|
||||
save: 'Enregistrer'
|
||||
},
|
||||
error: {
|
||||
onlyImg: 'Image uniquement',
|
||||
outOfSize: "L'image sélectionnée dépasse la taille maximum: ",
|
||||
lowestPx: "L'image sélectionnée est trop petite. Dimensions attendues: ",
|
||||
},
|
||||
lowestPx: "L'image sélectionnée est trop petite. Dimensions attendues: "
|
||||
}
|
||||
},
|
||||
nl: {
|
||||
hint: 'Klik hier of sleep een afbeelding in dit vlak',
|
||||
|
|
@ -145,13 +145,13 @@ export default {
|
|||
off: 'Annuleren',
|
||||
close: 'Sluiten',
|
||||
back: 'Terug',
|
||||
save: 'Opslaan',
|
||||
save: 'Opslaan'
|
||||
},
|
||||
error: {
|
||||
onlyImg: 'Alleen afbeeldingen',
|
||||
outOfSize: 'De afbeelding is groter dan: ',
|
||||
lowestPx: 'De afbeelding is te klein! Minimale afmetingen: ',
|
||||
},
|
||||
lowestPx: 'De afbeelding is te klein! Minimale afmetingen: '
|
||||
}
|
||||
},
|
||||
tr: {
|
||||
hint: 'Tıkla veya yüklemek istediğini buraya sürükle',
|
||||
|
|
@ -164,13 +164,13 @@ export default {
|
|||
off: 'İptal',
|
||||
close: 'Kapat',
|
||||
back: 'Geri',
|
||||
save: 'Kaydet',
|
||||
save: 'Kaydet'
|
||||
},
|
||||
error: {
|
||||
onlyImg: 'Sadece resim',
|
||||
outOfSize: 'Resim yükleme limitini aşıyor: ',
|
||||
lowestPx: 'Resmin boyutu çok küçük. En az olması gereken: ',
|
||||
},
|
||||
lowestPx: 'Resmin boyutu çok küçük. En az olması gereken: '
|
||||
}
|
||||
},
|
||||
'es-MX': {
|
||||
hint: 'Selecciona o arrastra una imagen',
|
||||
|
|
@ -183,13 +183,13 @@ export default {
|
|||
off: 'Cancelar',
|
||||
close: 'Cerrar',
|
||||
back: 'Atrás',
|
||||
save: 'Guardar',
|
||||
save: 'Guardar'
|
||||
},
|
||||
error: {
|
||||
onlyImg: 'Únicamente imágenes',
|
||||
outOfSize: 'La imagen excede el tamaño maximo:',
|
||||
lowestPx: 'La imagen es demasiado pequeña. Se espera por lo menos:',
|
||||
},
|
||||
lowestPx: 'La imagen es demasiado pequeña. Se espera por lo menos:'
|
||||
}
|
||||
},
|
||||
de: {
|
||||
hint: 'Klick hier oder zieh eine Datei hier rein zum Hochladen',
|
||||
|
|
@ -202,13 +202,13 @@ export default {
|
|||
off: 'Abbrechen',
|
||||
close: 'Schließen',
|
||||
back: 'Zurück',
|
||||
save: 'Speichern',
|
||||
save: 'Speichern'
|
||||
},
|
||||
error: {
|
||||
onlyImg: 'Nur Bilder',
|
||||
outOfSize: 'Das Bild ist zu groß: ',
|
||||
lowestPx: 'Das Bild ist zu klein. Mindestens: ',
|
||||
},
|
||||
lowestPx: 'Das Bild ist zu klein. Mindestens: '
|
||||
}
|
||||
},
|
||||
ja: {
|
||||
hint: 'クリック・ドラッグしてファイルをアップロード',
|
||||
|
|
@ -221,13 +221,13 @@ export default {
|
|||
off: 'キャンセル',
|
||||
close: '閉じる',
|
||||
back: '戻る',
|
||||
save: '保存',
|
||||
save: '保存'
|
||||
},
|
||||
error: {
|
||||
onlyImg: '画像のみ',
|
||||
outOfSize: '画像サイズが上限を超えています。上限: ',
|
||||
lowestPx: '画像が小さすぎます。最小サイズ: ',
|
||||
},
|
||||
lowestPx: '画像が小さすぎます。最小サイズ: '
|
||||
}
|
||||
},
|
||||
ua: {
|
||||
hint: 'Натисніть, або перетягніть файл в це вікно',
|
||||
|
|
@ -240,13 +240,13 @@ export default {
|
|||
off: 'Відмінити',
|
||||
close: 'Закрити',
|
||||
back: 'Назад',
|
||||
save: 'Зберегти',
|
||||
save: 'Зберегти'
|
||||
},
|
||||
error: {
|
||||
onlyImg: 'Тільки зображення',
|
||||
outOfSize: 'Зображення перевищує граничний розмір: ',
|
||||
lowestPx: 'Мінімальний розмір зображення: ',
|
||||
},
|
||||
lowestPx: 'Мінімальний розмір зображення: '
|
||||
}
|
||||
},
|
||||
it: {
|
||||
hint: 'Clicca o trascina qui il file per caricarlo',
|
||||
|
|
@ -259,13 +259,13 @@ export default {
|
|||
off: 'Annulla',
|
||||
close: 'Chiudi',
|
||||
back: 'Indietro',
|
||||
save: 'Salva',
|
||||
save: 'Salva'
|
||||
},
|
||||
error: {
|
||||
onlyImg: 'Sono accettate solo immagini',
|
||||
outOfSize: "L'immagine eccede i limiti di dimensione: ",
|
||||
lowestPx: "L'immagine è troppo piccola. Il requisito minimo è: ",
|
||||
},
|
||||
lowestPx: "L'immagine è troppo piccola. Il requisito minimo è: "
|
||||
}
|
||||
},
|
||||
ar: {
|
||||
hint: 'اضغط أو اسحب الملف هنا للتحميل',
|
||||
|
|
@ -278,13 +278,13 @@ export default {
|
|||
off: 'إلغاء',
|
||||
close: 'إغلاق',
|
||||
back: 'رجوع',
|
||||
save: 'حفظ',
|
||||
save: 'حفظ'
|
||||
},
|
||||
error: {
|
||||
onlyImg: 'صور فقط',
|
||||
outOfSize: 'تتجاوز الصوره الحجم المحدد: ',
|
||||
lowestPx: 'حجم الصورة صغير جدا. من المتوقع على الأقل: ',
|
||||
},
|
||||
lowestPx: 'حجم الصورة صغير جدا. من المتوقع على الأقل: '
|
||||
}
|
||||
},
|
||||
ug: {
|
||||
hint: 'مەزكۇر دائىرىنى چىكىپ رەسىم تاللاڭ ياكى رەسىمنى سۆرەپ ئەكىرىڭ',
|
||||
|
|
@ -297,13 +297,13 @@ export default {
|
|||
off: 'بولدى قىلىش',
|
||||
close: 'تاقاش',
|
||||
back: 'ئالدىنقى قەدەم',
|
||||
save: 'ساقلاش',
|
||||
save: 'ساقلاش'
|
||||
},
|
||||
error: {
|
||||
onlyImg: 'پەقەت رەسىم فورماتىنىلا قوللايدۇ',
|
||||
outOfSize: 'رەسىم چوڭ - كىچىكلىكى چەكتىن ئىشىپ كەتتى',
|
||||
lowestPx: 'رەسىمنىڭ ئەڭ كىچىك ئۆلچىمى :',
|
||||
},
|
||||
lowestPx: 'رەسىمنىڭ ئەڭ كىچىك ئۆلچىمى :'
|
||||
}
|
||||
},
|
||||
th: {
|
||||
hint: 'คลิ๊กหรือลากรูปมาที่นี่',
|
||||
|
|
@ -316,13 +316,13 @@ export default {
|
|||
off: 'ยกเลิก',
|
||||
close: 'ปิด',
|
||||
back: 'กลับ',
|
||||
save: 'บันทึก',
|
||||
save: 'บันทึก'
|
||||
},
|
||||
error: {
|
||||
onlyImg: 'ไฟล์ภาพเท่านั้น',
|
||||
outOfSize: 'ไฟล์ใหญ่เกินกำหนด: ',
|
||||
lowestPx: 'ไฟล์เล็กเกินไป. อย่างน้อยต้องมีขนาด: ',
|
||||
},
|
||||
lowestPx: 'ไฟล์เล็กเกินไป. อย่างน้อยต้องมีขนาด: '
|
||||
}
|
||||
},
|
||||
mm: {
|
||||
hint: 'ဖိုင်ကို ဤနေရာတွင် နှိပ်၍ (သို့) ဆွဲထည့်၍ တင်ပါ',
|
||||
|
|
@ -335,13 +335,13 @@ export default {
|
|||
off: 'မလုပ်တော့ပါ',
|
||||
close: 'ပိတ်မည်',
|
||||
back: 'နောက်သို့',
|
||||
save: 'သိမ်းမည်',
|
||||
save: 'သိမ်းမည်'
|
||||
},
|
||||
error: {
|
||||
onlyImg: 'ဓာတ်ပုံ သီးသန့်သာ',
|
||||
outOfSize: 'ဓာတ်ပုံဆိုဒ် ကြီးလွန်းသည် ။ အများဆုံး ဆိုဒ် : ',
|
||||
lowestPx: 'ဓာတ်ပုံဆိုဒ် သေးလွန်းသည်။ အနည်းဆုံး ဆိုဒ် : ',
|
||||
},
|
||||
lowestPx: 'ဓာတ်ပုံဆိုဒ် သေးလွန်းသည်။ အနည်းဆုံး ဆိုဒ် : '
|
||||
}
|
||||
},
|
||||
se: {
|
||||
hint: 'Klicka eller dra en fil hit för att ladda upp den',
|
||||
|
|
@ -354,12 +354,12 @@ export default {
|
|||
off: 'Avbryt',
|
||||
close: 'Stäng',
|
||||
back: 'Tillbaka',
|
||||
save: 'Spara',
|
||||
save: 'Spara'
|
||||
},
|
||||
error: {
|
||||
onlyImg: 'Endast bilder',
|
||||
outOfSize: 'Bilden är större än max-gränsen: ',
|
||||
lowestPx: 'Bilden är för liten. Minimum är: ',
|
||||
},
|
||||
},
|
||||
lowestPx: 'Bilden är för liten. Minimum är: '
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,5 +3,5 @@ export default {
|
|||
png: 'image/png',
|
||||
gif: 'image/gif',
|
||||
svg: 'image/svg+xml',
|
||||
psd: 'image/photoshop',
|
||||
psd: 'image/photoshop'
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,15 +12,15 @@ export default defineComponent({
|
|||
props: {
|
||||
iconName: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
required: true
|
||||
}
|
||||
},
|
||||
setup(props) {
|
||||
const icon = computed(() => `#icon-${props.iconName}`)
|
||||
return {
|
||||
icon,
|
||||
icon
|
||||
}
|
||||
},
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,6 @@ export default function () {
|
|||
}
|
||||
return {
|
||||
selectionIds,
|
||||
handleSelectionChange,
|
||||
handleSelectionChange
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ export function useDelete(removeService: IRemoveService, getData: { (): void },
|
|||
// })
|
||||
}
|
||||
return {
|
||||
handleDelete,
|
||||
handleDelete
|
||||
}
|
||||
}
|
||||
export default function <T = any>(configs: IConfigs) {
|
||||
|
|
@ -53,8 +53,8 @@ export default function <T = any>(configs: IConfigs) {
|
|||
params: {
|
||||
page: 1,
|
||||
rows,
|
||||
...params,
|
||||
},
|
||||
...params
|
||||
}
|
||||
})
|
||||
if (initParams) {
|
||||
state.params.params = handleSearchParam(initParams)
|
||||
|
|
@ -82,6 +82,6 @@ export default function <T = any>(configs: IConfigs) {
|
|||
loading,
|
||||
...toRefs(state),
|
||||
getList,
|
||||
handleDelete,
|
||||
handleDelete
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,6 @@
|
|||
export default {
|
||||
render: function (h) {
|
||||
return h()
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -47,9 +47,9 @@ export default {
|
|||
clearInterval(timer)
|
||||
})
|
||||
return {
|
||||
tipText,
|
||||
tipText
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
<script>
|
||||
export default {
|
||||
props: {
|
||||
pageConfigs: Object,
|
||||
pageConfigs: Object
|
||||
},
|
||||
watch: {
|
||||
firstPath() {
|
||||
|
|
@ -30,8 +30,8 @@ export default {
|
|||
handler: function () {
|
||||
this.initMenu('menuData')
|
||||
},
|
||||
immediate: true,
|
||||
},
|
||||
immediate: true
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
firstPath: function () {
|
||||
|
|
@ -42,7 +42,7 @@ export default {
|
|||
},
|
||||
hiddenSide() {
|
||||
return this.$route.meta.hiddenSide
|
||||
},
|
||||
}
|
||||
},
|
||||
created() {},
|
||||
methods: {
|
||||
|
|
@ -50,7 +50,7 @@ export default {
|
|||
if (item.selected) {
|
||||
return {
|
||||
backgroundColor: this.pageConfigs.headerSelectColour,
|
||||
color: this.pageConfigs.headerFontSelectColour,
|
||||
color: this.pageConfigs.headerFontSelectColour
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
@ -99,8 +99,8 @@ export default {
|
|||
} else {
|
||||
this.resetMenu(1)
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ export default defineComponent({
|
|||
'lockData',
|
||||
JSON.stringify({
|
||||
path: route.fullPath,
|
||||
isLock: true,
|
||||
isLock: true
|
||||
})
|
||||
)
|
||||
router.push({ name: 'LockMe' })
|
||||
|
|
@ -81,9 +81,9 @@ export default defineComponent({
|
|||
})
|
||||
onUnmounted(clearTimer)
|
||||
return {
|
||||
lockScreen,
|
||||
lockScreen
|
||||
}
|
||||
},
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<style scoped>
|
||||
|
|
|
|||
|
|
@ -13,16 +13,16 @@
|
|||
export default {
|
||||
props: {
|
||||
path: {
|
||||
type: String,
|
||||
type: String
|
||||
},
|
||||
meta: {
|
||||
type: Object,
|
||||
type: Object
|
||||
},
|
||||
defaultIcon: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
},
|
||||
default: ''
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
|
|
|||
|
|
@ -40,6 +40,6 @@ export default function (props: { mainMenu: boolean }) {
|
|||
}
|
||||
return {
|
||||
openKeys,
|
||||
handleOpenChange,
|
||||
handleOpenChange
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
export default {
|
||||
data() {
|
||||
return {
|
||||
selectionIds: [],
|
||||
selectionIds: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleSelectionChange(selections) {
|
||||
this.selectionIds = selections.map((item) => item.id)
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import { getToken } from 'utils/auth'
|
|||
export default {
|
||||
data() {
|
||||
return {
|
||||
webSocket: '',
|
||||
webSocket: ''
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
|
@ -14,7 +14,7 @@ export default {
|
|||
commonFun: this.messageCommonFun,
|
||||
pingMsg: 'HeartBeat',
|
||||
reConnectNum: 5,
|
||||
params: getToken(),
|
||||
params: getToken()
|
||||
})
|
||||
if (this.onmessage && typeof this.onmessage === 'function') {
|
||||
this.webSocket.onmessage = this.onmessage
|
||||
|
|
@ -25,6 +25,6 @@ export default {
|
|||
this.webSocket = null
|
||||
},
|
||||
methods: {
|
||||
messageCommonFun() {},
|
||||
},
|
||||
messageCommonFun() {}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,13 +4,13 @@ import routes from './constant'
|
|||
function createRoute() {
|
||||
return createRouter({
|
||||
history: createWebHistory(),
|
||||
routes,
|
||||
routes
|
||||
})
|
||||
}
|
||||
const router = createRoute()
|
||||
export const asyncRouterMap = {
|
||||
Home: () => import('@/layouts/home.vue'),
|
||||
App: () => import('@/layouts/app.vue'),
|
||||
App: () => import('@/layouts/app.vue')
|
||||
}
|
||||
export function resetRouter() {
|
||||
// const newRouter = createRoute();
|
||||
|
|
|
|||
|
|
@ -21,12 +21,12 @@ export function logout() {
|
|||
}
|
||||
export function getConfig(params) {
|
||||
return request.get('/sms/v1/logo', {
|
||||
params: wrapperParams(params),
|
||||
params: wrapperParams(params)
|
||||
})
|
||||
}
|
||||
export function getDict(data) {
|
||||
return request.get('/dict/children', {
|
||||
params: wrapperParams(data),
|
||||
params: wrapperParams(data)
|
||||
})
|
||||
}
|
||||
export function getSysconf() {
|
||||
|
|
@ -48,7 +48,7 @@ export function getPortal(params) {
|
|||
}
|
||||
export function getServiceQuota(tenantId, data) {
|
||||
return request.get(`/cos/v1/tenants/${tenantId}/quotas`, {
|
||||
params: wrapperParams(data),
|
||||
params: wrapperParams(data)
|
||||
})
|
||||
}
|
||||
export function replaceToken(params) {
|
||||
|
|
@ -69,7 +69,7 @@ export function getSystemTreeConfigs(params) {
|
|||
// 更新系统配置信息
|
||||
export function updateSystemConfigs(params) {
|
||||
return request.put('/sms/v1/system-configs', params, {
|
||||
headers: { 'Content-Type': 'multipart/form-data', BsmAjaxHeader: true, options: { noSeri: true } },
|
||||
headers: { 'Content-Type': 'multipart/form-data', BsmAjaxHeader: true, options: { noSeri: true } }
|
||||
})
|
||||
}
|
||||
// 测试连接
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ const baseUrl = '/sms/v1/config'
|
|||
|
||||
export function getStatus(params) {
|
||||
return request.get(`${baseUrl}/status`, {
|
||||
params,
|
||||
params
|
||||
})
|
||||
}
|
||||
export function getSid() {
|
||||
|
|
@ -15,7 +15,7 @@ export function getSid() {
|
|||
}
|
||||
export function getServer(params) {
|
||||
return request.get(`${baseUrl}/servers`, {
|
||||
params,
|
||||
params
|
||||
})
|
||||
}
|
||||
export function getLicense() {
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import type { IUser } from '@/models/user'
|
|||
const baseUrl = '/sms/v1/users'
|
||||
export function getUser(params: Base.IListParams) {
|
||||
return request.get<Base.IListData<IUser>>(baseUrl, {
|
||||
params,
|
||||
params
|
||||
})
|
||||
}
|
||||
export function getUserDetail(id: number) {
|
||||
|
|
@ -48,7 +48,7 @@ export function getRolesByUser(id: number) {
|
|||
}
|
||||
export function getTrack(params: Base.IListParams) {
|
||||
return request.get(`${baseUrl}/track`, {
|
||||
params,
|
||||
params
|
||||
})
|
||||
}
|
||||
export function exportUser(params: Base.IListParams) {
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import request from 'utils/request'
|
|||
const baseUrl = '/sms/v1/messages'
|
||||
export function getMessage(params) {
|
||||
return request.get(baseUrl, {
|
||||
params,
|
||||
params
|
||||
})
|
||||
}
|
||||
export function getMessageStats() {
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import { wrapperParams } from 'utils/index'
|
|||
const baseUrl = '/sms/v1/users'
|
||||
export function getUser(params) {
|
||||
return request.get(baseUrl, {
|
||||
params,
|
||||
params
|
||||
})
|
||||
}
|
||||
export function getUserDetail(id) {
|
||||
|
|
@ -32,7 +32,7 @@ export function getManager(id) {
|
|||
export function operateUser(id, action, params) {
|
||||
return request.patch(`${baseUrl}/${id}`, {
|
||||
action,
|
||||
...wrapperParams(params),
|
||||
...wrapperParams(params)
|
||||
})
|
||||
}
|
||||
export function checkStatus(data) {
|
||||
|
|
@ -45,6 +45,6 @@ export function getRolesByUser(id) {
|
|||
}
|
||||
export function getTrack(params) {
|
||||
return request.get(`${baseUrl}/track`, {
|
||||
params,
|
||||
params
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,6 @@ const getters = {
|
|||
userData: (state) => state.app.userData,
|
||||
pageConfig: (state) => state.app.pageConfig,
|
||||
systemConfig: (state) => state.app.systemConfig,
|
||||
appLoading: (state) => state.app.appLoading,
|
||||
appLoading: (state) => state.app.appLoading
|
||||
}
|
||||
export default getters
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
const state = {
|
||||
visitedViews: [],
|
||||
cachedViews: [],
|
||||
cachedViews: []
|
||||
}
|
||||
|
||||
const mutations = {
|
||||
ADD_VISITED_VIEW: (state, view) => {
|
||||
const {
|
||||
meta: { noTag, title },
|
||||
meta: { noTag, title }
|
||||
} = view
|
||||
if (noTag || !title) return
|
||||
if (state.visitedViews.some((v) => v.path === view.path)) return
|
||||
|
|
@ -64,7 +64,7 @@ const mutations = {
|
|||
},
|
||||
DEL_ALL_CACHED_VIEWS: (state) => {
|
||||
state.cachedViews = []
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
const actions = {
|
||||
|
|
@ -78,7 +78,7 @@ const actions = {
|
|||
commit('DEL_CACHED_VIEW', view)
|
||||
resolve({
|
||||
visitedViews: [...state.visitedViews],
|
||||
cachedViews: [...state.cachedViews],
|
||||
cachedViews: [...state.cachedViews]
|
||||
})
|
||||
})
|
||||
},
|
||||
|
|
@ -88,7 +88,7 @@ const actions = {
|
|||
commit('DEL_OTHERS_CACHED_VIEWS', view)
|
||||
resolve({
|
||||
visitedViews: [...state.visitedViews],
|
||||
cachedViews: [...state.cachedViews],
|
||||
cachedViews: [...state.cachedViews]
|
||||
})
|
||||
})
|
||||
},
|
||||
|
|
@ -98,7 +98,7 @@ const actions = {
|
|||
commit('UPDATE_CACHE_VIEWS')
|
||||
resolve({
|
||||
visitedViews: [...state.visitedViews],
|
||||
cachedViews: [...state.cachedViews],
|
||||
cachedViews: [...state.cachedViews]
|
||||
})
|
||||
})
|
||||
},
|
||||
|
|
@ -108,7 +108,7 @@ const actions = {
|
|||
commit('UPDATE_CACHE_VIEWS')
|
||||
resolve({
|
||||
visitedViews: [...state.visitedViews],
|
||||
cachedViews: [...state.cachedViews],
|
||||
cachedViews: [...state.cachedViews]
|
||||
})
|
||||
})
|
||||
},
|
||||
|
|
@ -118,15 +118,15 @@ const actions = {
|
|||
commit('DEL_ALL_CACHED_VIEWS')
|
||||
resolve({
|
||||
visitedViews: [...state.visitedViews],
|
||||
cachedViews: [...state.cachedViews],
|
||||
cachedViews: [...state.cachedViews]
|
||||
})
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state,
|
||||
mutations,
|
||||
actions,
|
||||
actions
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ const iv = CryptoJS.enc.Utf8.parse(decryptByBase64('QmV5b25kQ01QVjU4NyEhIQ=='))
|
|||
const options = {
|
||||
iv,
|
||||
mode: CryptoJS.mode.CBC,
|
||||
padding: CryptoJS.pad.Pkcs7,
|
||||
padding: CryptoJS.pad.Pkcs7
|
||||
}
|
||||
|
||||
// 加密方法
|
||||
|
|
@ -41,5 +41,5 @@ export default {
|
|||
encrypt,
|
||||
decrypt,
|
||||
encryptByBase64,
|
||||
decryptByBase64,
|
||||
decryptByBase64
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ export default function uploadFile(item, callback, errorCallBack) {
|
|||
socket.send(
|
||||
JSON.stringify({
|
||||
filename: item.file.name,
|
||||
upload: 'file',
|
||||
upload: 'file'
|
||||
})
|
||||
)
|
||||
// 取消上传
|
||||
|
|
@ -23,7 +23,7 @@ export default function uploadFile(item, callback, errorCallBack) {
|
|||
item.progress = 0
|
||||
socket.send(
|
||||
JSON.stringify({
|
||||
UPLOAD_CANCEL: 'UPLOAD_CANCEL',
|
||||
UPLOAD_CANCEL: 'UPLOAD_CANCEL'
|
||||
})
|
||||
)
|
||||
item.isUploading = false
|
||||
|
|
@ -56,7 +56,7 @@ export default function uploadFile(item, callback, errorCallBack) {
|
|||
item.progress = 100
|
||||
socket.send(
|
||||
JSON.stringify({
|
||||
sendover: 'sendover',
|
||||
sendover: 'sendover'
|
||||
})
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,9 +46,9 @@ export default defineComponent({
|
|||
setup() {
|
||||
const state = reactive({
|
||||
loginForm: {
|
||||
password: '',
|
||||
password: ''
|
||||
},
|
||||
loading: false,
|
||||
loading: false
|
||||
})
|
||||
let timer: any = 0
|
||||
const store = useStore()
|
||||
|
|
@ -56,14 +56,14 @@ export default defineComponent({
|
|||
// 当前时间设置
|
||||
const currentTime = ref({
|
||||
time: '',
|
||||
date: '',
|
||||
date: ''
|
||||
})
|
||||
function setTimer() {
|
||||
const getTime = () => {
|
||||
const time = dayjs()
|
||||
currentTime.value = {
|
||||
time: time.format('HH:mm:ss'),
|
||||
date: `${time.format('MM月DD日')}, ${time.format('dddd')}`,
|
||||
date: `${time.format('MM月DD日')}, ${time.format('dddd')}`
|
||||
}
|
||||
}
|
||||
getTime()
|
||||
|
|
@ -73,7 +73,7 @@ export default defineComponent({
|
|||
}
|
||||
let lockData = {
|
||||
isLock: false,
|
||||
path: '',
|
||||
path: ''
|
||||
}
|
||||
onMounted(() => {
|
||||
const lockDataItem = localStorage.getItem('lockData')
|
||||
|
|
@ -83,7 +83,7 @@ export default defineComponent({
|
|||
'lockData',
|
||||
JSON.stringify({
|
||||
...lockData,
|
||||
isLock: true,
|
||||
isLock: true
|
||||
})
|
||||
)
|
||||
setTimer()
|
||||
|
|
@ -103,7 +103,7 @@ export default defineComponent({
|
|||
const res = await login({
|
||||
account: userData.value.account,
|
||||
password: encrypt(values.password),
|
||||
isManager: true,
|
||||
isManager: true
|
||||
})
|
||||
if (res.success) {
|
||||
setLoginData(res.data)
|
||||
|
|
@ -113,7 +113,7 @@ export default defineComponent({
|
|||
'lockData',
|
||||
JSON.stringify({
|
||||
...lockData,
|
||||
isLock: false,
|
||||
isLock: false
|
||||
})
|
||||
)
|
||||
}
|
||||
|
|
@ -129,9 +129,9 @@ export default defineComponent({
|
|||
loginFormRef,
|
||||
required,
|
||||
switchUser,
|
||||
handleLogin,
|
||||
handleLogin
|
||||
}
|
||||
},
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,42 +1,35 @@
|
|||
<template>
|
||||
<div class="login-container" :style="{ backgroundImage: `url(${configs.loginBg || '/web-common-resource/img/bg_login.png'})` }">
|
||||
<div class="login-logo">
|
||||
<img :src="configs.loginLogo" alt />
|
||||
</div>
|
||||
<div class="login-center">
|
||||
<div class="desc-content">
|
||||
<span class="desc-title">{{ configs.promotionalTitle }}</span>
|
||||
<span class="desc-remark">{{ configs.promotionalContent }}</span>
|
||||
<div class="login-content">
|
||||
<!-- 左侧蓝色面板 -->
|
||||
<div class="left-panel">
|
||||
<span class="title-text">多云管理平台</span>
|
||||
</div>
|
||||
|
||||
<!-- 右侧白色登录表单 -->
|
||||
<div class="right-panel">
|
||||
<div class="right-panel-content">
|
||||
<div class="login-title">欢迎登录</div>
|
||||
<el-form :model="loginForm" ref="loginFormRef" label-position="top" class="login-form" @keyup.enter="handleLogin">
|
||||
<el-form-item class="login-form-item" prop="account" label="账号" :rules="[{ ...required, message: '请输入账户' }]">
|
||||
<el-input v-model="loginForm.account" autocomplete="off" placeholder="请输入账户" size="large" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item class="login-form-item" prop="password" label="密码" :rules="[{ ...required, message: '请输入密码' }]">
|
||||
<el-input v-model="loginForm.password" type="password" show-password placeholder="请输入密码" autocomplete="off" size="large" @blur="capsTooltip = false" @keyup="checkCapslock" />
|
||||
</el-form-item>
|
||||
|
||||
<div class="form-options">
|
||||
<div class="remember-password">
|
||||
<el-checkbox v-model="remember">记住密码</el-checkbox>
|
||||
</div>
|
||||
<a :href="`mailto:${configs.helpInformationLink}`" class="help-link">{{ configs.helpInformationContent || '获取帮助' }}</a>
|
||||
</div>
|
||||
|
||||
<el-button class="login-btn" type="primary" size="large" :loading="loading" @click="handleLogin">登录</el-button>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
<a-form :model="loginForm" ref="loginFormRef" label-position="left" label-width="0px" class="card-box login-form" @keyup.enter="handleLogin">
|
||||
<div class="login-title">账号登录</div>
|
||||
<a-form-item class="login-form-item" name="account" :rules="[{ ...required, message: '请输入用户名' }]">
|
||||
<a-input v-model:value="loginForm.account" autocomplete="off" placeholder="登录账户">
|
||||
<template #prefix>
|
||||
<UserOutlined />
|
||||
</template>
|
||||
</a-input>
|
||||
</a-form-item>
|
||||
<a-tooltip v-model="capsTooltip" content="大写锁定已打开" placement="right" manual>
|
||||
<a-form-item class="login-form-item" name="password" :rules="[{ ...required, message: '请输入密码' }]">
|
||||
<a-input-password name="password" prefix-icon="el-icon-lock" v-model:value="loginForm.password" placeholder="密码" autocomplete="false" @blur="capsTooltip = false" @keyup="checkCapslock">
|
||||
<template #prefix>
|
||||
<LockOutlined />
|
||||
</template>
|
||||
</a-input-password>
|
||||
</a-form-item>
|
||||
</a-tooltip>
|
||||
<a-form-item class="login-form-item">
|
||||
<div class="operate-region">
|
||||
<span class="remember">
|
||||
<a-switch v-model:checked="remember"></a-switch>
|
||||
<span class="m-l-xs">记住密码</span>
|
||||
</span>
|
||||
<a :href="`mailto:${configs.helpInformationLink}`" type="text" class="text-info pull-right help-info" :title="configs.helpInformationContent">{{ configs.helpInformationContent }}</a>
|
||||
</div>
|
||||
</a-form-item>
|
||||
<a-button class="login-btn" type="primary" size="medium" :loading="loading" @click="handleLogin">登录</a-button>
|
||||
</a-form>
|
||||
</div>
|
||||
<div class="copyright-info">{{ configs.copyrightInformation }}</div>
|
||||
</div>
|
||||
|
|
@ -46,23 +39,23 @@
|
|||
import { decrypt, encrypt } from 'utils/crypto'
|
||||
import { login } from 'services'
|
||||
import { reactive, toRefs, ref, computed } from 'vue'
|
||||
import { UserOutlined, LockOutlined } from '@ant-design/icons-vue'
|
||||
import { useStore } from 'vuex'
|
||||
import { useRouter, useRoute } from 'vue-router'
|
||||
import setLoginData from './tools'
|
||||
import { required } from '@/validate'
|
||||
|
||||
export default {
|
||||
components: { UserOutlined, LockOutlined },
|
||||
name: 'LoginPage',
|
||||
setup() {
|
||||
const state = reactive({
|
||||
remember: false,
|
||||
userType: 'tenant', // 'tenant' 或 'user'
|
||||
loginForm: {
|
||||
account: '',
|
||||
password: '',
|
||||
password: ''
|
||||
},
|
||||
loading: false,
|
||||
capsTooltip: false,
|
||||
capsTooltip: false
|
||||
})
|
||||
const store = useStore()
|
||||
const configs = computed(() => store.getters.pageConfig)
|
||||
|
|
@ -84,7 +77,7 @@ export default {
|
|||
if (state.remember) {
|
||||
const obj = {
|
||||
account: state.loginForm.account,
|
||||
password: encrypt(state.loginForm.password),
|
||||
password: encrypt(state.loginForm.password)
|
||||
}
|
||||
localStorage.setItem('cmcLoginData', JSON.stringify(obj))
|
||||
} else {
|
||||
|
|
@ -99,17 +92,19 @@ export default {
|
|||
async function handleLogin() {
|
||||
try {
|
||||
state.loading = true
|
||||
const values = await loginFormRef.value.validate()
|
||||
const { account, password } = values
|
||||
await loginFormRef.value.validate()
|
||||
const { account, password } = state.loginForm
|
||||
const res = await login({
|
||||
account,
|
||||
password: encrypt(password),
|
||||
isManager: true,
|
||||
isManager: true
|
||||
})
|
||||
if (res.success) {
|
||||
goLogin(res.data)
|
||||
}
|
||||
} catch (error) {}
|
||||
} catch (error) {
|
||||
// 登录错误处理
|
||||
}
|
||||
state.loading = false
|
||||
}
|
||||
|
||||
|
|
@ -121,7 +116,7 @@ export default {
|
|||
state.capsTooltip = false
|
||||
}
|
||||
}
|
||||
if (key === 'CapsLock' && this.capsTooltip === true) {
|
||||
if (key === 'CapsLock' && state.capsTooltip === true) {
|
||||
state.capsTooltip = false
|
||||
}
|
||||
}
|
||||
|
|
@ -131,107 +126,204 @@ export default {
|
|||
configs,
|
||||
loginFormRef,
|
||||
handleLogin,
|
||||
checkCapslock,
|
||||
checkCapslock
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.login-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100vh;
|
||||
position: relative;
|
||||
background: url('/web-common-resource/img/bg_login.png') #2d3a4b no-repeat;
|
||||
background-size: cover;
|
||||
.login-logo {
|
||||
padding: 5px 40px;
|
||||
img {
|
||||
height: 40px;
|
||||
}
|
||||
}
|
||||
.login-center {
|
||||
.login-content {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
justify-content: space-around;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
width: 90%;
|
||||
max-width: 1200px;
|
||||
z-index: 1;
|
||||
align-items: center;
|
||||
.desc-content {
|
||||
color: #fff;
|
||||
justify-content: center;
|
||||
min-height: 600px;
|
||||
|
||||
// 左侧蓝色面板
|
||||
.left-panel {
|
||||
flex: 1;
|
||||
height: 100%;
|
||||
min-height: 700px;
|
||||
background: rgba(4, 121, 231, 0.463); // 半透明蓝色
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin-top: -150x;
|
||||
width: 600px;
|
||||
.desc-title {
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
// backdrop-filter: blur(1px);
|
||||
padding: 60px 50px;
|
||||
|
||||
.title-text {
|
||||
width: 80%;
|
||||
font-size: 28px;
|
||||
font-weight: 700;
|
||||
font-style: normal;
|
||||
font-size: 38px;
|
||||
color: #ffffff;
|
||||
margin-bottom: 56px;
|
||||
}
|
||||
.desc-remark {
|
||||
line-height: 40px;
|
||||
font-weight: 400;
|
||||
font-style: normal;
|
||||
font-size: 22px;
|
||||
color: #ffffff;
|
||||
position: absolute;
|
||||
top: 5%;
|
||||
left: 5%;
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
|
||||
}
|
||||
}
|
||||
.login-form {
|
||||
box-sizing: border-box;
|
||||
width: 462px;
|
||||
padding: 50px 30px;
|
||||
background: #fff;
|
||||
font-size: 17px;
|
||||
|
||||
// 右侧白色面板
|
||||
.right-panel {
|
||||
flex: 1;
|
||||
height: 100%;
|
||||
background: #ffffff;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 60px 50px;
|
||||
.right-panel-content {
|
||||
width: 83%;
|
||||
min-height: 580px;
|
||||
}
|
||||
.login-title {
|
||||
font-size: 32px;
|
||||
font-size: 30px;
|
||||
font-weight: 600;
|
||||
color: #1890ff;
|
||||
text-align: center;
|
||||
color: #333;
|
||||
margin-bottom: 50px;
|
||||
margin-bottom: 40px;
|
||||
text-align: left;
|
||||
line-height: 130px;
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
|
||||
}
|
||||
.operate-region {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.remember {
|
||||
flex: 1;
|
||||
text-align: left;
|
||||
}
|
||||
}
|
||||
.login-btn {
|
||||
margin-top: 20px;
|
||||
height: 60px;
|
||||
|
||||
.login-form {
|
||||
width: 100%;
|
||||
}
|
||||
.help-info {
|
||||
max-width: 130px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.login-form-item {
|
||||
::v-deep(.ant-input-affix-wrapper) {
|
||||
height: 60px;
|
||||
line-height: 60px;
|
||||
}
|
||||
::v-deep(.ant-input-prefix) {
|
||||
padding-left: 50px;
|
||||
}
|
||||
::v-deep {
|
||||
.a-input__icon {
|
||||
height: 100%;
|
||||
max-width: 400px;
|
||||
|
||||
// 用户类型选择器
|
||||
.user-type-selector {
|
||||
display: flex;
|
||||
margin-bottom: 30px;
|
||||
background: #f5f5f5;
|
||||
border-radius: 8px;
|
||||
padding: 4px;
|
||||
gap: 4px;
|
||||
|
||||
.type-item {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
padding: 12px 20px;
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s;
|
||||
font-size: 16px;
|
||||
color: #666;
|
||||
background: transparent;
|
||||
|
||||
&:hover {
|
||||
background: rgba(24, 144, 255, 0.1);
|
||||
}
|
||||
|
||||
&.active {
|
||||
background: #595959;
|
||||
color: #ffffff;
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
.ant-input-prefix {
|
||||
font-size: 20px;
|
||||
padding: 0 10px;
|
||||
}
|
||||
|
||||
.login-form-item {
|
||||
margin-bottom: 24px;
|
||||
|
||||
::v-deep(.el-form-item__label) {
|
||||
padding-bottom: 8px;
|
||||
font-size: 14px;
|
||||
color: #333;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
::v-deep(.el-input__wrapper) {
|
||||
min-height: 48px;
|
||||
border-radius: 4px;
|
||||
|
||||
.el-input__inner {
|
||||
height: 48px;
|
||||
line-height: 48px;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
box-shadow: 0 0 0 1px #40a9ff inset;
|
||||
}
|
||||
|
||||
&.is-focus {
|
||||
box-shadow: 0 0 0 1px #1890ff inset;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.form-options {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 30px;
|
||||
|
||||
.remember-password {
|
||||
::v-deep(.el-checkbox) {
|
||||
font-size: 14px;
|
||||
color: #666;
|
||||
|
||||
.el-checkbox__label {
|
||||
font-size: 14px;
|
||||
color: #666;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.help-link {
|
||||
color: #1890ff;
|
||||
font-size: 14px;
|
||||
text-decoration: none;
|
||||
cursor: pointer;
|
||||
|
||||
&:hover {
|
||||
color: #40a9ff;
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.login-btn {
|
||||
width: 100%;
|
||||
height: 48px;
|
||||
font-size: 16px;
|
||||
font-weight: 500;
|
||||
border-radius: 4px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.copyright-info {
|
||||
width: 100%;
|
||||
padding: 10px 0;
|
||||
text-align: center;
|
||||
background: rgba(10, 37, 68, 0.6);
|
||||
color: #bbbbbb;
|
||||
position: fixed;
|
||||
z-index: 1;
|
||||
font-size: 12px;
|
||||
bottom: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,237 @@
|
|||
<template>
|
||||
<div class="login-container" :style="{ backgroundImage: `url(${configs.loginBg || '/web-common-resource/img/bg_login.png'})` }">
|
||||
<div class="login-logo">
|
||||
<img :src="configs.loginLogo" alt />
|
||||
</div>
|
||||
<div class="login-center">
|
||||
<div class="desc-content">
|
||||
<span class="desc-title">{{ configs.promotionalTitle }}</span>
|
||||
<span class="desc-remark">{{ configs.promotionalContent }}</span>
|
||||
</div>
|
||||
<a-form :model="loginForm" ref="loginFormRef" label-position="left" label-width="0px" class="card-box login-form" @keyup.enter="handleLogin">
|
||||
<div class="login-title">账号登录</div>
|
||||
<a-form-item class="login-form-item" name="account" :rules="[{ ...required, message: '请输入用户名' }]">
|
||||
<a-input v-model:value="loginForm.account" autocomplete="off" placeholder="登录账户">
|
||||
<template #prefix>
|
||||
<UserOutlined />
|
||||
</template>
|
||||
</a-input>
|
||||
</a-form-item>
|
||||
<a-tooltip v-model="capsTooltip" content="大写锁定已打开" placement="right" manual>
|
||||
<a-form-item class="login-form-item" name="password" :rules="[{ ...required, message: '请输入密码' }]">
|
||||
<a-input-password name="password" prefix-icon="el-icon-lock" v-model:value="loginForm.password" placeholder="密码" autocomplete="false" @blur="capsTooltip = false" @keyup="checkCapslock">
|
||||
<template #prefix>
|
||||
<LockOutlined />
|
||||
</template>
|
||||
</a-input-password>
|
||||
</a-form-item>
|
||||
</a-tooltip>
|
||||
<a-form-item class="login-form-item">
|
||||
<div class="operate-region">
|
||||
<span class="remember">
|
||||
<a-switch v-model:checked="remember"></a-switch>
|
||||
<span class="m-l-xs">记住密码</span>
|
||||
</span>
|
||||
<a :href="`mailto:${configs.helpInformationLink}`" type="text" class="text-info pull-right help-info" :title="configs.helpInformationContent">{{ configs.helpInformationContent }}</a>
|
||||
</div>
|
||||
</a-form-item>
|
||||
<a-button class="login-btn" type="primary" size="medium" :loading="loading" @click="handleLogin">登录</a-button>
|
||||
</a-form>
|
||||
</div>
|
||||
<div class="copyright-info">{{ configs.copyrightInformation }}</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { decrypt, encrypt } from 'utils/crypto'
|
||||
import { login } from 'services'
|
||||
import { reactive, toRefs, ref, computed } from 'vue'
|
||||
import { UserOutlined, LockOutlined } from '@ant-design/icons-vue'
|
||||
import { useStore } from 'vuex'
|
||||
import { useRouter, useRoute } from 'vue-router'
|
||||
import setLoginData from './tools'
|
||||
import { required } from '@/validate'
|
||||
|
||||
export default {
|
||||
components: { UserOutlined, LockOutlined },
|
||||
setup() {
|
||||
const state = reactive({
|
||||
remember: false,
|
||||
loginForm: {
|
||||
account: '',
|
||||
password: ''
|
||||
},
|
||||
loading: false,
|
||||
capsTooltip: false
|
||||
})
|
||||
const store = useStore()
|
||||
const configs = computed(() => store.getters.pageConfig)
|
||||
const loginFormRef = ref(null)
|
||||
const init = () => {
|
||||
const local = localStorage.getItem('cmcLoginData')
|
||||
if (local) {
|
||||
const obj = JSON.parse(local)
|
||||
state.loginForm.account = obj.account
|
||||
state.loginForm.password = decrypt(obj.password)
|
||||
state.remember = true
|
||||
}
|
||||
}
|
||||
init()
|
||||
const router = useRouter()
|
||||
const route = useRoute()
|
||||
function goLogin(data) {
|
||||
setLoginData(data)
|
||||
if (state.remember) {
|
||||
const obj = {
|
||||
account: state.loginForm.account,
|
||||
password: encrypt(state.loginForm.password)
|
||||
}
|
||||
localStorage.setItem('cmcLoginData', JSON.stringify(obj))
|
||||
} else {
|
||||
localStorage.removeItem('cmcLoginData')
|
||||
}
|
||||
const { redirect } = route.query
|
||||
const path = redirect ? redirect.split('/#')[1] : '/sms-web/resource_dashboard'
|
||||
router.replace(path)
|
||||
localStorage.removeItem('lockData')
|
||||
}
|
||||
|
||||
async function handleLogin() {
|
||||
try {
|
||||
state.loading = true
|
||||
const values = await loginFormRef.value.validate()
|
||||
const { account, password } = values
|
||||
const res = await login({
|
||||
account,
|
||||
password: encrypt(password),
|
||||
isManager: true
|
||||
})
|
||||
if (res.success) {
|
||||
goLogin(res.data)
|
||||
}
|
||||
} catch (error) {}
|
||||
state.loading = false
|
||||
}
|
||||
|
||||
function checkCapslock({ shiftKey, key } = {}) {
|
||||
if (key && key.length === 1) {
|
||||
if ((shiftKey && key >= 'a' && key <= 'z') || (!shiftKey && key >= 'A' && key <= 'Z')) {
|
||||
state.capsTooltip = true
|
||||
} else {
|
||||
state.capsTooltip = false
|
||||
}
|
||||
}
|
||||
if (key === 'CapsLock' && this.capsTooltip === true) {
|
||||
state.capsTooltip = false
|
||||
}
|
||||
}
|
||||
return {
|
||||
...toRefs(state),
|
||||
required,
|
||||
configs,
|
||||
loginFormRef,
|
||||
handleLogin,
|
||||
checkCapslock
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.login-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100vh;
|
||||
background: url('/web-common-resource/img/bg_login.png') #2d3a4b no-repeat;
|
||||
background-size: cover;
|
||||
.login-logo {
|
||||
padding: 5px 40px;
|
||||
img {
|
||||
height: 40px;
|
||||
}
|
||||
}
|
||||
.login-center {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
justify-content: space-around;
|
||||
align-items: center;
|
||||
.desc-content {
|
||||
color: #fff;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin-top: -150x;
|
||||
width: 600px;
|
||||
.desc-title {
|
||||
font-weight: 700;
|
||||
font-style: normal;
|
||||
font-size: 38px;
|
||||
color: #ffffff;
|
||||
margin-bottom: 56px;
|
||||
}
|
||||
.desc-remark {
|
||||
line-height: 40px;
|
||||
font-weight: 400;
|
||||
font-style: normal;
|
||||
font-size: 22px;
|
||||
color: #ffffff;
|
||||
}
|
||||
}
|
||||
.login-form {
|
||||
box-sizing: border-box;
|
||||
width: 462px;
|
||||
padding: 50px 30px;
|
||||
background: #fff;
|
||||
font-size: 17px;
|
||||
.login-title {
|
||||
font-size: 32px;
|
||||
text-align: center;
|
||||
color: #333;
|
||||
margin-bottom: 50px;
|
||||
}
|
||||
.operate-region {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.remember {
|
||||
flex: 1;
|
||||
text-align: left;
|
||||
}
|
||||
}
|
||||
.login-btn {
|
||||
margin-top: 20px;
|
||||
height: 60px;
|
||||
width: 100%;
|
||||
}
|
||||
.help-info {
|
||||
max-width: 130px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.login-form-item {
|
||||
::v-deep(.ant-input-affix-wrapper) {
|
||||
height: 60px;
|
||||
line-height: 60px;
|
||||
}
|
||||
::v-deep(.ant-input-prefix) {
|
||||
padding-left: 50px;
|
||||
}
|
||||
::v-deep {
|
||||
.a-input__icon {
|
||||
height: 100%;
|
||||
}
|
||||
.ant-input-prefix {
|
||||
font-size: 20px;
|
||||
padding: 0 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.copyright-info {
|
||||
padding: 10px 0;
|
||||
text-align: center;
|
||||
background: rgba(10, 37, 68, 0.6);
|
||||
color: #bbbbbb;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Loading…
Reference in New Issue