Commit c7125f7d by 胡悦

提交优化内容

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