Commit c7125f7d by 胡悦

提交优化内容

1 parent 199b2128
...@@ -14,6 +14,7 @@ declare global { ...@@ -14,6 +14,7 @@ declare global {
const ElFormItem: typeof import('element-plus/es')['ElFormItem'] const ElFormItem: typeof import('element-plus/es')['ElFormItem']
const ElIcon: typeof import('element-plus/es')['ElIcon'] const ElIcon: typeof import('element-plus/es')['ElIcon']
const ElInput: typeof import('element-plus/es')['ElInput'] const ElInput: typeof import('element-plus/es')['ElInput']
const ElLink: typeof import('element-plus/es')['ElLink']
const ElMain: typeof import('element-plus/es')['ElMain'] const ElMain: typeof import('element-plus/es')['ElMain']
const ElOption: typeof import('element-plus/es')['ElOption'] const ElOption: typeof import('element-plus/es')['ElOption']
const ElPagination: typeof import('element-plus/es')['ElPagination'] const ElPagination: typeof import('element-plus/es')['ElPagination']
......
...@@ -21,6 +21,7 @@ declare module '@vue/runtime-core' { ...@@ -21,6 +21,7 @@ declare module '@vue/runtime-core' {
ElFormItem: typeof import('element-plus/es')['ElFormItem'] ElFormItem: typeof import('element-plus/es')['ElFormItem']
ElIcon: typeof import('element-plus/es')['ElIcon'] ElIcon: typeof import('element-plus/es')['ElIcon']
ElInput: typeof import('element-plus/es')['ElInput'] ElInput: typeof import('element-plus/es')['ElInput']
ElLink: typeof import('element-plus/es')['ElLink']
ElMain: typeof import('element-plus/es')['ElMain'] ElMain: typeof import('element-plus/es')['ElMain']
ElOption: typeof import('element-plus/es')['ElOption'] ElOption: typeof import('element-plus/es')['ElOption']
ElPagination: typeof import('element-plus/es')['ElPagination'] ElPagination: typeof import('element-plus/es')['ElPagination']
......
<!--
* @Description:
* @Author: huyue
* @Date: 2023-08-31 11:35:41
* @LastEditors: huyue
* @LastEditTime: 2023-10-26 14:29:54
-->
<template> <template>
<!-- <nav> <!-- <nav>
<router-link to="/">Home</router-link> | <router-link to="/">Home</router-link> |
...@@ -5,7 +12,12 @@ ...@@ -5,7 +12,12 @@
</nav> --> </nav> -->
<router-view class="warp-content" /> <router-view class="warp-content" />
</template> </template>
<script lang="ts" setup>
import { onMounted } from 'vue'
onMounted(() => {
document.body.style.setProperty('--el-color-primary', '#5850FF')
})
</script>
<style lang="scss"> <style lang="scss">
* { * {
padding: 0; padding: 0;
......

101 KB | W: | H:

103 KB | W: | H:

src/assets/project.png
src/assets/project.png
src/assets/project.png
src/assets/project.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -3,11 +3,11 @@ ...@@ -3,11 +3,11 @@
* @Author: huyue * @Author: huyue
* @Date: 2023-02-21 17:16:18 * @Date: 2023-02-21 17:16:18
* @LastEditors: huyue * @LastEditors: huyue
* @LastEditTime: 2023-07-24 18:23:05 * @LastEditTime: 2023-10-26 16:16:48
--> -->
<template> <template>
<div class="wrapper-content"> <div class="wrapper-content">
<div> <div class="search-item">
<el-input <el-input
:size="data.size" :size="data.size"
class="search-input" class="search-input"
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
<el-table <el-table
:data="data.tableData" :data="data.tableData"
style="width: 100%" style="width: 100%;border-radius: 10px;"
border border
:row-class-name="tableRowClassName" :row-class-name="tableRowClassName"
> >
...@@ -117,7 +117,7 @@ const data = reactive<DataType>({ ...@@ -117,7 +117,7 @@ const data = reactive<DataType>({
password: [], password: [],
showPassword: [], showPassword: [],
search: "", search: "",
size: "small", size: "middle",
createModalVisible: false, createModalVisible: false,
}); });
// 修改密码 // 修改密码
...@@ -195,9 +195,11 @@ onMounted(() => { ...@@ -195,9 +195,11 @@ onMounted(() => {
width: 800px; width: 800px;
margin: 20px auto; margin: 20px auto;
} }
.search-item {
margin-bottom: 10px;
}
.search-input { .search-input {
width: 300px; width: 300px;
margin-bottom: 20px;
margin-right: 20px; margin-right: 20px;
} }
.pwd-input { .pwd-input {
......
...@@ -255,7 +255,7 @@ export default defineComponent({ ...@@ -255,7 +255,7 @@ export default defineComponent({
width: 350px; width: 350px;
padding: 20px; padding: 20px;
box-sizing: border-box; box-sizing: border-box;
background: #67c23a; background: #878789;
.info { .info {
color: #fff; color: #fff;
margin-bottom: 40px; margin-bottom: 40px;
......
...@@ -3,14 +3,20 @@ ...@@ -3,14 +3,20 @@
<div id="wrap" class="wrap"> <div id="wrap" class="wrap">
<!-- 主体 --> <!-- 主体 -->
<div class="topbar"> <div class="topbar">
<img <div style="user-select:none;" @click="goPage">前端配置资源库</div>
<!-- <img
src="../assets/logo.png" src="../assets/logo.png"
v-preventReClick v-preventReClick
@click="goPage" @click="goPage"
class="logo" class="logo"
/> /> -->
<div class="wrap-right"> <div class="wrap-right">
<div v-if="isShowConfig" class="right-menu" @click="goConfigPage"> <!-- <div class="document">
<el-icon style="vertical-align: middle"><Document /></el-icon>
</div> -->
<el-link class="document" :icon="Document" target="_blank" href="https://kdocs.cn/l/cmpr2L8XQZco">使用指南</el-link>
<div class="line"></div>
<div class="right-menu" @click="goConfigPage">
{{ pageFlag == 0 ? "公共配置" : "环境配置" }} {{ pageFlag == 0 ? "公共配置" : "环境配置" }}
</div> </div>
<!-- <div class="right-menu" @click="goEnvironmentPage">环境配置</div> --> <!-- <div class="right-menu" @click="goEnvironmentPage">环境配置</div> -->
...@@ -57,6 +63,7 @@ import editUerMessage from "./editUerMessage.vue"; ...@@ -57,6 +63,7 @@ import editUerMessage from "./editUerMessage.vue";
import { userDel } from "@/api/login"; import { userDel } from "@/api/login";
import { ref, onMounted } from "vue"; import { ref, onMounted } from "vue";
import { ElMessage, ElMessageBox } from "element-plus"; import { ElMessage, ElMessageBox } from "element-plus";
import { Document } from "@element-plus/icons";
const router = useRouter(); const router = useRouter();
const editUerMessageModalVisible = ref(false); const editUerMessageModalVisible = ref(false);
const userInfo = JSON.parse(sessionStorage.getItem("userInfo") || ""); const userInfo = JSON.parse(sessionStorage.getItem("userInfo") || "");
...@@ -90,7 +97,6 @@ const account = () => { ...@@ -90,7 +97,6 @@ const account = () => {
}; };
const pageFlag = ref(0); const pageFlag = ref(0);
const isShowConfig = ref(false)
const goConfigPage = () => { const goConfigPage = () => {
switch (pageFlag.value) { switch (pageFlag.value) {
...@@ -139,10 +145,6 @@ const delUser = async () => { ...@@ -139,10 +145,6 @@ const delUser = async () => {
}); });
}; };
onMounted(() => {
const isAdmin = userInfo && userInfo.roleId === 1 ? true : false;
isShowConfig.value = isAdmin
})
</script> </script>
...@@ -158,12 +160,11 @@ onMounted(() => { ...@@ -158,12 +160,11 @@ onMounted(() => {
background: #f0f2f5; background: #f0f2f5;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
.logo { background-color: #5850FF;
width: 30px; color: #fff;
height: 30px; padding-left: 20px;
}
.el-dropdown-link { .el-dropdown-link {
color: #666; color: #fff;
font-size: 14px; font-size: 14px;
margin-right: 20px; margin-right: 20px;
line-height: 30px; line-height: 30px;
...@@ -171,10 +172,25 @@ onMounted(() => { ...@@ -171,10 +172,25 @@ onMounted(() => {
height: 30px; height: 30px;
text-decoration: none; text-decoration: none;
} }
.wrap-right {
align-items: center;
.document {
color: #fff;
font-size: 16px;
}
.line {
width: 1px;
height: 20px;
margin: 0 20px;
background-color: #bbb;
}
}
} }
.main-content { .main-content {
overflow-y: auto; overflow-y: auto;
flex: 1; flex: 1;
background-color: rgba(88, 80, 255, 0.05);
} }
&-right { &-right {
display: flex; display: flex;
......
...@@ -151,8 +151,8 @@ const loginEvent = async (formEl: FormInstance | undefined) => { ...@@ -151,8 +151,8 @@ const loginEvent = async (formEl: FormInstance | undefined) => {
left: 0px; left: 0px;
width: 100%; width: 100%;
height: 100%; height: 100%;
background: url("../assets/project.png") center center no-repeat; background: url("../assets/home.png") center center no-repeat;
background-size: 100% 100%; background-size: cover;
} }
.login_warp { .login_warp {
...@@ -174,7 +174,7 @@ const loginEvent = async (formEl: FormInstance | undefined) => { ...@@ -174,7 +174,7 @@ const loginEvent = async (formEl: FormInstance | undefined) => {
display: block; display: block;
width: 372px; width: 372px;
height: 40px; height: 40px;
background-color: rgba(4, 139, 66, 0.9); background-color: #5850ff9c;
color: #fff; color: #fff;
border: none; border: none;
font-size: 16px; font-size: 16px;
...@@ -183,13 +183,13 @@ const loginEvent = async (formEl: FormInstance | undefined) => { ...@@ -183,13 +183,13 @@ const loginEvent = async (formEl: FormInstance | undefined) => {
margin-top: 30px; margin-top: 30px;
} }
.btn_login:hover { .btn_login:hover {
background-color: #00a84d; // background-color: #00a84d;
} }
.input_box { .input_box {
display: flex; display: flex;
align-items: center; align-items: center;
background: rgb(29, 45, 61); background: #5850ff2e;
position: relative; position: relative;
width: 372px; width: 372px;
height: 42px; height: 42px;
......
...@@ -18,12 +18,13 @@ ...@@ -18,12 +18,13 @@
@click="goToList(item)" @click="goToList(item)"
> >
<img <img
style="width: 100%; height: 240px" style="width: 100%"
src="../../assets/project.png" src="../../assets/project.png"
class="image" class="image"
/> />
<div style="padding: 14px; position: relative"> <div style="padding: 14px; position: relative">
<span>项目名称:{{ item.name }}</span> <span>项目名称:{{ item.name }}</span>
<div>addr: {{item.addr}}</div>
<div>项目备注:{{ item.remark }}</div> <div>项目备注:{{ item.remark }}</div>
<div class="bottom"> <div class="bottom">
<el-button <el-button
...@@ -66,8 +67,8 @@ ...@@ -66,8 +67,8 @@
@click="goToEdit(item)" @click="goToEdit(item)"
> >
<img <img
style="width: 100%; height: 240px" style="width: 100%;"
src="../../assets/project.png" :src="require(`../../assets/${item.name == 'production' ? 'production-banner':'test-banner'}.png`)"
class="image" class="image"
/> />
<div style="padding: 14px; position: relative"> <div style="padding: 14px; position: relative">
......
...@@ -307,7 +307,7 @@ export default defineComponent({ ...@@ -307,7 +307,7 @@ export default defineComponent({
width: 350px; width: 350px;
padding: 20px; padding: 20px;
box-sizing: border-box; box-sizing: border-box;
background: #67c23a; background: #878789;
.info { .info {
color: #fff; color: #fff;
margin-bottom: 40px; margin-bottom: 40px;
......
...@@ -3,12 +3,12 @@ ...@@ -3,12 +3,12 @@
* @Author: huyue * @Author: huyue
* @Date: 2023-01-30 16:10:23 * @Date: 2023-01-30 16:10:23
* @LastEditors: huyue * @LastEditors: huyue
* @LastEditTime: 2023-07-31 14:51:34 * @LastEditTime: 2023-10-26 16:19:40
--> -->
<template> <template>
<div class="api-list"> <div class="api-list">
<h3>项目接口</h3> <h3>项目接口</h3>
<div> <div class="search-item">
<el-input class="search-input" v-model="apiData.urlInput" clearable placeholder="请输入url" /> <el-input class="search-input" v-model="apiData.urlInput" clearable placeholder="请输入url" />
<el-button class="search-button" @click="search" type="primary">查询</el-button> <el-button class="search-button" @click="search" type="primary">查询</el-button>
<el-button class="search-button" :isDisabled="disabled" v-preventReClick @click="addFn" type="primary">新建</el-button> <el-button class="search-button" :isDisabled="disabled" v-preventReClick @click="addFn" type="primary">新建</el-button>
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<el-table-column prop="remark" label="remark" /> <el-table-column prop="remark" label="remark" />
<el-table-column prop="username" label="操作人" /> <el-table-column prop="username" label="操作人" />
<el-table-column prop="updateDate" label="更新时间" /> <el-table-column prop="updateDate" label="更新时间" />
<el-table-column label="操作" width="300"> <el-table-column label="操作" width="450">
<template #default="scope"> <template #default="scope">
<el-button <el-button
type="text" type="text"
...@@ -228,9 +228,11 @@ export default { ...@@ -228,9 +228,11 @@ export default {
text-align: center; text-align: center;
} }
} }
.search-item {
margin-bottom: 10px;
}
.search-input { .search-input {
width: 300px; width: 300px;
margin-bottom: 20px;
} }
.search-button { .search-button {
margin-left: 20px; margin-left: 20px;
......
...@@ -7,6 +7,7 @@ import { ...@@ -7,6 +7,7 @@ import {
withDefaults, withDefaults,
watch, watch,
onBeforeUnmount, onBeforeUnmount,
onMounted
} from "vue"; } from "vue";
import type { FormInstance, FormRules } from "element-plus"; import type { FormInstance, FormRules } from "element-plus";
import { ElMessage, ElMessageBox } from "element-plus"; import { ElMessage, ElMessageBox } from "element-plus";
...@@ -173,6 +174,13 @@ const isUniqueName = async () => { ...@@ -173,6 +174,13 @@ const isUniqueName = async () => {
} }
return true; return true;
}; };
const isAuth = ref(false)
onMounted(() => {
const userInfo = JSON.parse(sessionStorage.getItem("userInfo") || "");
const isAdmin = userInfo && userInfo.roleId === 1 ? true : false;
isAuth.value = isAdmin
})
</script> </script>
<template> <template>
...@@ -214,7 +222,7 @@ const isUniqueName = async () => { ...@@ -214,7 +222,7 @@ const isUniqueName = async () => {
<el-form-item label="描述" prop="remark"> <el-form-item label="描述" prop="remark">
<el-input v-model="ruleForm.remark" type="textarea" /> <el-input v-model="ruleForm.remark" type="textarea" />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item v-if="isAuth">
<el-button <el-button
type="primary" type="primary"
v-preventReClick v-preventReClick
......
...@@ -6,7 +6,8 @@ import { ...@@ -6,7 +6,8 @@ import {
defineProps, defineProps,
withDefaults, withDefaults,
watch, watch,
onUnmounted onUnmounted,
onMounted
} from "vue"; } from "vue";
import type { FormInstance, FormRules, Action } from "element-plus"; import type { FormInstance, FormRules, Action } from "element-plus";
import { ElMessage, ElMessageBox } from "element-plus"; import { ElMessage, ElMessageBox } from "element-plus";
...@@ -157,6 +158,13 @@ const deletModel = () => { ...@@ -157,6 +158,13 @@ const deletModel = () => {
onUnmounted(() =>{ onUnmounted(() =>{
isEdit.value = false isEdit.value = false
}) })
const isAuth = ref(false)
onMounted(() => {
const userInfo = JSON.parse(sessionStorage.getItem("userInfo") || "");
console.log(userInfo);
const isAdmin = userInfo && userInfo.roleId === 1 ? true : false;
isAuth.value = isAdmin
})
</script> </script>
<template> <template>
...@@ -165,7 +173,7 @@ onUnmounted(() =>{ ...@@ -165,7 +173,7 @@ onUnmounted(() =>{
<h3>{{isEdit ? '编辑' : '新增'}}模板</h3> <h3>{{isEdit ? '编辑' : '新增'}}模板</h3>
<el-button <el-button
@click="deletModel" @click="deletModel"
v-if="isEdit" v-if="isEdit && isAuth"
type="danger" type="danger"
:icon="Delete" :icon="Delete"
circle circle
...@@ -192,7 +200,7 @@ onUnmounted(() =>{ ...@@ -192,7 +200,7 @@ onUnmounted(() =>{
<el-form-item label="描述" prop="remark"> <el-form-item label="描述" prop="remark">
<el-input v-model="ruleForm.remark" type="textarea" /> <el-input v-model="ruleForm.remark" type="textarea" />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item v-if="isAuth">
<el-button <el-button
type="primary" type="primary"
v-preventReClick v-preventReClick
......
<script setup lang="ts"> <script setup lang="ts">
import { onBeforeMount, reactive, markRaw, nextTick } from "vue"; import { onBeforeMount, reactive, markRaw, nextTick, onMounted, ref } from "vue";
import ConfigAdd from "./AddConfig.vue"; import ConfigAdd from "./AddConfig.vue";
import ModelAdd from "./AddModel.vue"; import ModelAdd from "./AddModel.vue";
import OperationRecord from "./OperationRecord.vue"; import OperationRecord from "./OperationRecord.vue";
...@@ -109,6 +109,12 @@ const clickTabShow = (index: number) => { ...@@ -109,6 +109,12 @@ const clickTabShow = (index: number) => {
tabData[index].tabShow = !tabData[index].tabShow; tabData[index].tabShow = !tabData[index].tabShow;
} }
const isAuth = ref(false)
onMounted(() => {
const userInfo = JSON.parse(sessionStorage.getItem("userInfo") || "");
const isAdmin = userInfo && userInfo.roleId === 1 ? true : false;
isAuth.value = isAdmin
})
</script> </script>
<template> <template>
...@@ -133,7 +139,7 @@ const clickTabShow = (index: number) => { ...@@ -133,7 +139,7 @@ const clickTabShow = (index: number) => {
</div> </div>
{{ item.label }} {{ item.label }}
</div> </div>
<el-icon @click="addConfig(index)"><CirclePlus /></el-icon> <el-icon v-if="isAuth" @click="addConfig(index)"><CirclePlus /></el-icon>
</div> </div>
<template v-if="item.children?.length && item.tabShow"> <template v-if="item.children?.length && item.tabShow">
<div <div
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!