优化
This commit is contained in:
@@ -78,9 +78,15 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item prop="content">
|
||||
<span style="color: #9ca3af">描述: 请从技术栈,功能,适用场景,解决那些痛点等方面介绍项目,突出特点和闪光的亮点。</span>
|
||||
<el-tiptap style="margin-top: 5px" v-model="form.content" :readonly="false" :showMenubar="true"
|
||||
:extensions="extensions"/>
|
||||
<el-input
|
||||
type="textarea"
|
||||
placeholder="描述: 请从技术栈,功能,适用场景,解决那些痛点等方面介绍项目,突出特点和闪光的亮点。"
|
||||
v-model="form.content"
|
||||
maxlength="500"
|
||||
rows="5"
|
||||
show-word-limit
|
||||
>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item style="display: flex;flex-direction: row;justify-content: flex-end">
|
||||
<el-button type="primary" @click="submitProject" round>提交<i class="el-icon-s-promotion"></i></el-button>
|
||||
@@ -136,19 +142,7 @@
|
||||
import SearchInput from "@/components/Home/SearchInput.vue";
|
||||
import PublishArticle from "@/components/Paper/PublishArticle.vue";
|
||||
import Vue from "vue";
|
||||
import {
|
||||
Blockquote,
|
||||
Bold, BulletList,
|
||||
CodeBlock, CodeView,
|
||||
Doc, FontSize, FontType, FormatClear, HardBreak,
|
||||
Heading, History, HorizontalRule,
|
||||
Iframe,
|
||||
Image, Indent, Italic, LineHeight,
|
||||
Link, ListItem, OrderedList,
|
||||
Paragraph, Preview, Print, SelectAll, Strike,
|
||||
Text, TextAlign, TextColor, TextHighlight, TodoItem, TodoList, TrailingNode,
|
||||
Underline
|
||||
} from "element-tiptap";
|
||||
|
||||
import axios from "axios";
|
||||
|
||||
export default {
|
||||
@@ -159,45 +153,6 @@ export default {
|
||||
openPublishArticle:false,
|
||||
openPublishProject:false,
|
||||
openFileUploadDialog:false,
|
||||
extensions: [
|
||||
new Link,
|
||||
new Image,
|
||||
new Iframe,
|
||||
new CodeBlock,
|
||||
new Blockquote,
|
||||
new Doc(),
|
||||
new Text(),
|
||||
new Paragraph(),
|
||||
new Heading({level: 5}), // 支持多级标题,设置为5级
|
||||
new Bold({bubble: true}), // 在气泡菜单中渲染菜单按钮
|
||||
new Underline({bubble: true, menubar: false}), // 在气泡菜单而不在菜单栏中渲染菜单按钮
|
||||
new Italic(),
|
||||
new Strike(),
|
||||
new ListItem(),
|
||||
new BulletList(),
|
||||
new OrderedList(),
|
||||
new TodoItem,
|
||||
new TodoList,
|
||||
new TextAlign({alignments: ['left', 'center', 'right', 'justify'],}),
|
||||
new Indent({
|
||||
minIndent: 0,
|
||||
maxIndent: 7,
|
||||
}),
|
||||
new LineHeight({lineHeights: ['100%', '200%', '300%']}),
|
||||
new HorizontalRule,
|
||||
new HardBreak,
|
||||
new TrailingNode,
|
||||
new History,
|
||||
new FormatClear,
|
||||
new TextColor({bubble: true}),
|
||||
new TextHighlight,
|
||||
new Preview,
|
||||
new Print,
|
||||
new SelectAll,
|
||||
new FontType,
|
||||
new FontSize,
|
||||
new CodeView,
|
||||
],
|
||||
form: {
|
||||
url: null,
|
||||
title: null,
|
||||
|
@@ -17,7 +17,7 @@
|
||||
</div>
|
||||
<div v-if="historySearch!==null" v-show="this.$cookie.get('username')!=null">
|
||||
<el-tag
|
||||
v-if="historySearch.length!==0"
|
||||
v-if="historySearch.length!==1"
|
||||
v-for="(tag,index) in historySearch"
|
||||
:key="index"
|
||||
size="small"
|
||||
|
@@ -28,10 +28,10 @@
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="24">
|
||||
<el-card shadow="always" style="font-size: 18px;
|
||||
text-align:left;background-color: #f4ffed;
|
||||
text-align:left;background-color: #e2f1ec;
|
||||
border-color: rgba(255,243,232,0.89);border-radius:10px">
|
||||
<span style="font-size:20px;font-weight:550">「HelloGitHub 月刊」</span>
|
||||
分享 GitHub 上有趣、入门级的开源项目,每月 28 号发布最新一期。内容包
|
||||
分享 GitHub 上有趣、入门级的开源项目,每月 1 号发布最新一期。内容包
|
||||
括开发利器、开源书籍、教程、企业级项目等, 让你发现编程的乐趣、爱上开源!
|
||||
</el-card>
|
||||
</el-col>
|
||||
|
@@ -11,7 +11,7 @@
|
||||
</el-page-header>
|
||||
</div>
|
||||
<div class="PageContent" style="display: flex;flex-direction: column;flex-wrap: nowrap;align-items: center">
|
||||
<el-image fit="cover" style="width: 50vw; height: 35vh;margin-top: 20px" :src="articleico">
|
||||
<el-image fit="cover" style="box-shadow: 0 2px 4px rgba(0, 0, 0, .12), 0 0 6px rgba(0, 0, 0, .04);width: 50vw; height: 35vh;margin-top: 20px" :src="articleico">
|
||||
<div slot="placeholder" class="image-slot">
|
||||
加载中<span class="dot">...</span>
|
||||
</div>
|
||||
|
@@ -74,7 +74,7 @@ export default {
|
||||
},
|
||||
// 截取文章内容的前 35 个字,并加上省略号
|
||||
brief: function() {
|
||||
return this.projectLists.projectDescription.substr(0, 33) + '...';
|
||||
return this.projectLists.projectDescription.substr(0, 40) + '...';
|
||||
},
|
||||
|
||||
},
|
||||
|
@@ -72,6 +72,7 @@
|
||||
:inactive-value="0"
|
||||
active-color="#13ce66"
|
||||
inactive-color="#ff4949"
|
||||
@change="handleChangeStatus($event,scope.row.commentId)"
|
||||
>
|
||||
</el-switch>
|
||||
</template>
|
||||
@@ -92,41 +93,43 @@
|
||||
<el-dialog title="编辑" :visible.sync="dialogVisible" width="45%"
|
||||
append-to-body
|
||||
:close-on-click-modal="false"
|
||||
:before-close="closeDialog"
|
||||
>
|
||||
<el-form ref="ruleForm" class="login_container" :model="form" status-icon label-width="80px">
|
||||
<el-form-item label="ID" prop="commentId">
|
||||
<el-input v-model="form.commentId" placeholder='ID' clearable disabled></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="用户名ID" prop="userId">
|
||||
<el-input v-model="form.userId" placeholder='用户ID' clearable></el-input>
|
||||
<el-input v-model="form.userId" placeholder='用户ID' clearable :disabled="isEdit"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="项目ID" prop="projectId">
|
||||
<el-input v-model="form.projectId"
|
||||
:disabled="isEdit"
|
||||
placeholder='项目ID'
|
||||
clearable></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="评论内容" prop="content">
|
||||
<el-input type="textarea" v-model="form.content" placeholder="评论内容" :rows="5"></el-input>
|
||||
<el-input type="textarea" v-model="form.content" placeholder="评论内容" :rows="5" :disabled="isEdit"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="是否使用过" prop="isUsed">
|
||||
<el-input v-model="form.isUsed" placeholder='是否使用过' clearable></el-input>
|
||||
<el-input v-model="form.isUsed" placeholder='是否使用过' clearable :disabled="isEdit"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="评论时间" prop="commentTime">
|
||||
<el-input v-model="form.commentTime" placeholder='评论时间' clearable></el-input>
|
||||
<el-input v-model="form.commentTime" placeholder='评论时间' clearable :disabled="isEdit"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="评分" prop="star">
|
||||
<el-input v-model="form.star" placeholder='评分' clearable></el-input>
|
||||
<el-input v-model="form.star" placeholder='评分' clearable :disabled="isEdit"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="点赞数" prop="fileAddress">
|
||||
<el-input v-model="form.likeNum" placeholder='点赞数' clearable></el-input>
|
||||
<el-input v-model="form.likeNum" placeholder='点赞数' clearable :disabled="isEdit"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否有效" prop="isValid">
|
||||
<el-radio-group v-model="form.isValid">
|
||||
<el-radio-group v-model="form.isValid" :disabled="isEdit">
|
||||
<el-radio :label="1">有效</el-radio>
|
||||
<el-radio :label="0">无效</el-radio>
|
||||
</el-radio-group>
|
||||
@@ -152,6 +155,7 @@ export default {
|
||||
data(){
|
||||
return{
|
||||
dataTable:[],
|
||||
isEdit:true,
|
||||
dialogVisible:false,
|
||||
form:{
|
||||
commentId:'',
|
||||
@@ -168,6 +172,86 @@ export default {
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
handleChangeStatus($event, id){
|
||||
if ($event === 1) { // 这里判断一下
|
||||
// 启用
|
||||
this.$confirm('确认启用吗?', '操作确认', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(async () => {
|
||||
axios({
|
||||
method: 'post',
|
||||
// 请求的地址
|
||||
url: 'http://localhost:8082/helloGithub_war_exploded/updateisValid_comment',
|
||||
// URL 中的查询参数
|
||||
params: {
|
||||
commentId:id,
|
||||
isValid:$event
|
||||
}
|
||||
}).then(function (res) {
|
||||
if (res.data.code === 200) {
|
||||
Vue.prototype.$notify({
|
||||
title: '成功',
|
||||
message: ('i', {style: 'color: teal'}, res.data.msg),
|
||||
type: 'success',
|
||||
offset: 50
|
||||
});
|
||||
} else {
|
||||
Vue.prototype.$notify.error({
|
||||
title: '错误',
|
||||
message: res.data.msg,
|
||||
offset: 50
|
||||
});
|
||||
}
|
||||
})
|
||||
})
|
||||
.catch(() => {})
|
||||
} else {
|
||||
// 禁用
|
||||
this.$confirm('确认禁用吗?', '操作确认', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(async () => {
|
||||
axios({
|
||||
method: 'post',
|
||||
// 请求的地址
|
||||
url: 'http://localhost:8082/helloGithub_war_exploded/updateisValid_comment',
|
||||
// URL 中的查询参数
|
||||
params: {
|
||||
commentId:id,
|
||||
isValid:$event
|
||||
}
|
||||
}).then(function (res) {
|
||||
if (res.data.code === 200) {
|
||||
Vue.prototype.$notify({
|
||||
title: '成功',
|
||||
message: ('i', {style: 'color: teal'}, res.data.msg),
|
||||
type: 'success',
|
||||
offset: 50
|
||||
});
|
||||
} else {
|
||||
Vue.prototype.$notify.error({
|
||||
title: '错误',
|
||||
message: res.data.msg,
|
||||
offset: 50
|
||||
});
|
||||
}
|
||||
})
|
||||
})
|
||||
.catch(() => {})
|
||||
}
|
||||
},
|
||||
closeDialog() {
|
||||
// 先重置
|
||||
this.getAllComment();
|
||||
// 后关闭
|
||||
this.dialogVisible = false;
|
||||
this.isEdit=true;
|
||||
},
|
||||
getAllComment(){
|
||||
var that=this;
|
||||
axios({
|
||||
|
@@ -96,6 +96,7 @@
|
||||
:inactive-value="0"
|
||||
active-color="#13ce66"
|
||||
inactive-color="#ff4949"
|
||||
@change="handleChangeStatus($event,scope.row.projectId)"
|
||||
>
|
||||
</el-switch>
|
||||
</template>
|
||||
@@ -116,58 +117,60 @@
|
||||
<el-dialog title="编辑" :visible.sync="dialogVisible" width="45%"
|
||||
append-to-body
|
||||
:close-on-click-modal="false"
|
||||
:before-close="closeDialog"
|
||||
>
|
||||
<el-form ref="ruleForm" class="login_container" :model="form" status-icon label-width="70px">
|
||||
<el-form-item label="ID" prop="projectId">
|
||||
<el-input v-model="form.projectId" placeholder='ID' clearable disabled></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="用户名" prop="userId">
|
||||
<el-input v-model="form.userId" placeholder='用户ID' clearable></el-input>
|
||||
<el-input v-model="form.userId" placeholder='用户ID' clearable :disabled="isEdit"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="项目名称" prop="projectTitle">
|
||||
<el-input v-model="form.projectName"
|
||||
:disabled="isEdit"
|
||||
placeholder='项目名称'
|
||||
clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="项目地址" prop="projectIco">
|
||||
<el-input v-model="form.projectUrl" placeholder='项目地址' clearable></el-input>
|
||||
<el-input v-model="form.projectUrl" placeholder='项目地址' clearable :disabled="isEdit"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="项目图标" prop="projectIco">
|
||||
<el-input v-model="form.projectIco" placeholder='项目图标' clearable></el-input>
|
||||
<el-input v-model="form.projectIco" placeholder='项目图标' clearable :disabled="isEdit"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="标题" prop="projectTitle">
|
||||
<el-input v-model="form.projectTitle" placeholder='标题' clearable></el-input>
|
||||
<el-input v-model="form.projectTitle" placeholder='标题' clearable :disabled="isEdit"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="项目描述" prop="projectDescription">
|
||||
<el-input type="textarea" v-model="form.projectDescription" placeholder="项目描述" :rows="5"></el-input>
|
||||
<el-input type="textarea" v-model="form.projectDescription" placeholder="项目描述" :rows="5" :disabled="isEdit"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="点赞数" prop="startNum">
|
||||
<el-input v-model="form.startNum" placeholder='点赞数' clearable></el-input>
|
||||
<el-input v-model="form.startNum" placeholder='点赞数' clearable :disabled="isEdit"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="提交时间" prop="submitTime">
|
||||
<el-input v-model="form.submitTime" placeholder='提交时间' clearable></el-input>
|
||||
<el-input v-model="form.submitTime" placeholder='提交时间' clearable :disabled="isEdit"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="标签" prop="categoryId">
|
||||
<el-input v-model="form.categoryId" placeholder='标签' clearable></el-input>
|
||||
<el-input v-model="form.categoryId" placeholder='标签' clearable :disabled="isEdit"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="文件地址" prop="fileAddress">
|
||||
<el-input v-model="form.fileAddress" placeholder='文件地址' clearable></el-input>
|
||||
<el-input v-model="form.fileAddress" placeholder='文件地址' clearable :disabled="isEdit"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="期刊" prop="periodicals">
|
||||
<el-input v-model="form.periodicals" placeholder='期刊' clearable></el-input>
|
||||
<el-input v-model="form.periodicals" placeholder='期刊' clearable :disabled="isEdit"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="查看数" prop="lookCount">
|
||||
<el-input v-model="form.lookCount" placeholder='查看数' clearable></el-input>
|
||||
<el-input v-model="form.lookCount" placeholder='查看数' clearable :disabled="isEdit"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="是否有效" prop="isValid">
|
||||
<el-radio-group v-model="form.isValid">
|
||||
<el-radio-group v-model="form.isValid" :disabled="isEdit">
|
||||
<el-radio :label="1">有效</el-radio>
|
||||
<el-radio :label="0">无效</el-radio>
|
||||
</el-radio-group>
|
||||
@@ -175,7 +178,7 @@
|
||||
|
||||
<el-form-item>
|
||||
<div style="display: flex;flex-direction: row;align-items: center;flex-wrap: nowrap;justify-content: space-between">
|
||||
<el-button @click="resetForm('ruleForm')">重置</el-button>
|
||||
<el-button @click="editForm()">编辑</el-button>
|
||||
<el-button @click="submit('ruleForm')" type="primary" style=";margin-top:10px">提交</el-button>
|
||||
</div>
|
||||
</el-form-item>
|
||||
@@ -195,6 +198,7 @@ export default {
|
||||
data(){
|
||||
return {
|
||||
dataTable:[],
|
||||
isEdit:true,
|
||||
dialogVisible:false,
|
||||
form:{
|
||||
projectId:'',
|
||||
@@ -216,6 +220,89 @@ export default {
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
handleChangeStatus($event, id){
|
||||
if ($event === 1) { // 这里判断一下
|
||||
// 启用
|
||||
this.$confirm('确认启用吗?', '操作确认', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(async () => {
|
||||
axios({
|
||||
method: 'post',
|
||||
// 请求的地址
|
||||
url: 'http://localhost:8082/helloGithub_war_exploded/updateisValid_project',
|
||||
// URL 中的查询参数
|
||||
params: {
|
||||
projectId:id,
|
||||
isValid:$event
|
||||
}
|
||||
}).then(function (res) {
|
||||
if (res.data.code === 200) {
|
||||
Vue.prototype.$notify({
|
||||
title: '成功',
|
||||
message: ('i', {style: 'color: teal'}, res.data.msg),
|
||||
type: 'success',
|
||||
offset: 50
|
||||
});
|
||||
} else {
|
||||
Vue.prototype.$notify.error({
|
||||
title: '错误',
|
||||
message: res.data.msg,
|
||||
offset: 50
|
||||
});
|
||||
}
|
||||
})
|
||||
})
|
||||
.catch(() => {})
|
||||
} else {
|
||||
// 禁用
|
||||
this.$confirm('确认禁用吗?', '操作确认', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(async () => {
|
||||
axios({
|
||||
method: 'post',
|
||||
// 请求的地址
|
||||
url: 'http://localhost:8082/helloGithub_war_exploded/updateisValid_project',
|
||||
// URL 中的查询参数
|
||||
params: {
|
||||
projectId:id,
|
||||
isValid:$event
|
||||
}
|
||||
}).then(function (res) {
|
||||
if (res.data.code === 200) {
|
||||
Vue.prototype.$notify({
|
||||
title: '成功',
|
||||
message: ('i', {style: 'color: teal'}, res.data.msg),
|
||||
type: 'success',
|
||||
offset: 50
|
||||
});
|
||||
} else {
|
||||
Vue.prototype.$notify.error({
|
||||
title: '错误',
|
||||
message: res.data.msg,
|
||||
offset: 50
|
||||
});
|
||||
}
|
||||
})
|
||||
})
|
||||
.catch(() => {})
|
||||
}
|
||||
},
|
||||
editForm(){
|
||||
this.isEdit=false;
|
||||
},
|
||||
closeDialog() {
|
||||
// 先重置
|
||||
this.getAllProject();
|
||||
// 后关闭
|
||||
this.dialogVisible = false;
|
||||
this.isEdit=true;
|
||||
},
|
||||
getAllProject(){
|
||||
var that=this;
|
||||
axios({
|
||||
|
@@ -41,6 +41,7 @@
|
||||
:inactive-value="0"
|
||||
active-color="#13ce66"
|
||||
inactive-color="#ff4949"
|
||||
@change="handleChangeStatus($event,scope.row.adminId)"
|
||||
>
|
||||
</el-switch>
|
||||
</template>
|
||||
@@ -63,20 +64,33 @@
|
||||
:before-close="closeDialog"
|
||||
>
|
||||
<el-form ref="ruleForm" class="login_container" :model="form" status-icon :rules="rules" label-width="70px">
|
||||
<el-form-item label="adminID">
|
||||
<el-input v-model="form.adminId" placeholder='ID' clearable disabled></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="账 户" prop="username">
|
||||
<el-input v-model="form.adminName" placeholder='请输入用户名' clearable></el-input>
|
||||
<el-input v-model="form.adminName" placeholder='请输入用户名' :disabled="isEdit"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="密 码" prop="password">
|
||||
<el-input type="password" v-model="form.adminPassword"
|
||||
:disabled="isEdit"
|
||||
placeholder='请输入密码'
|
||||
clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="登录时间">
|
||||
<el-input v-model="form.loginTime" placeholder='登录时间' clearable disabled></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否有效">
|
||||
<el-radio-group v-model="form.isValid" :disabled="isEdit">
|
||||
<el-radio :label="1">有效</el-radio>
|
||||
<el-radio :label="0">无效</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<div style="display: flex;flex-direction: row;align-items: center;flex-wrap: nowrap;justify-content: space-between">
|
||||
<el-button @click="resetForm('ruleForm')">重置</el-button>
|
||||
<el-button @click="submit('ruleForm')" type="primary" style=";margin-top:10px">提交</el-button>
|
||||
<el-button @click="editForm()">编辑</el-button>
|
||||
<el-button @click="submit()" type="primary" style=";margin-top:10px">保存</el-button>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@@ -94,13 +108,17 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
modalType: 0,
|
||||
isEdit:true,
|
||||
dialogVisible:false,
|
||||
dataTable:null,
|
||||
imageUrl: "http://localhost:8082/helloGithub_war_exploded/VerifycodeServlet?" + new Date().getDate(),
|
||||
// 登陆数据
|
||||
form: {
|
||||
adminId:'',
|
||||
adminName: '',
|
||||
adminPassword: '',
|
||||
isValid:'',
|
||||
loginTime:'',
|
||||
},
|
||||
// 校验规则
|
||||
rules: {
|
||||
@@ -114,6 +132,79 @@ export default {
|
||||
this.getAllAdmin();
|
||||
},
|
||||
methods: {
|
||||
handleChangeStatus($event, id){
|
||||
if ($event === 1) { // 这里判断一下
|
||||
// 启用
|
||||
this.$confirm('确认启用吗?', '操作确认', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(async () => {
|
||||
axios({
|
||||
method: 'post',
|
||||
// 请求的地址
|
||||
url: 'http://localhost:8082/helloGithub_war_exploded/updateisValid_admin',
|
||||
// URL 中的查询参数
|
||||
params: {
|
||||
adminId:id,
|
||||
isValid:$event
|
||||
}
|
||||
}).then(function (res) {
|
||||
if (res.data.code === 200) {
|
||||
Vue.prototype.$notify({
|
||||
title: '成功',
|
||||
message: ('i', {style: 'color: teal'}, res.data.msg),
|
||||
type: 'success',
|
||||
offset: 50
|
||||
});
|
||||
} else {
|
||||
Vue.prototype.$notify.error({
|
||||
title: '错误',
|
||||
message: res.data.msg,
|
||||
offset: 50
|
||||
});
|
||||
}
|
||||
})
|
||||
})
|
||||
.catch(() => {})
|
||||
} else {
|
||||
// 禁用
|
||||
this.$confirm('确认禁用吗?', '操作确认', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(async () => {
|
||||
axios({
|
||||
method: 'post',
|
||||
// 请求的地址
|
||||
url: 'http://localhost:8082/helloGithub_war_exploded/updateisValid_admin',
|
||||
// URL 中的查询参数
|
||||
params: {
|
||||
adminId:id,
|
||||
isValid:$event
|
||||
}
|
||||
}).then(function (res) {
|
||||
if (res.data.code === 200) {
|
||||
Vue.prototype.$notify({
|
||||
title: '成功',
|
||||
message: ('i', {style: 'color: teal'}, res.data.msg),
|
||||
type: 'success',
|
||||
offset: 50
|
||||
});
|
||||
} else {
|
||||
Vue.prototype.$notify.error({
|
||||
title: '错误',
|
||||
message: res.data.msg,
|
||||
offset: 50
|
||||
});
|
||||
}
|
||||
})
|
||||
})
|
||||
.catch(() => {})
|
||||
}
|
||||
},
|
||||
getAllAdmin(){
|
||||
var that=this;
|
||||
axios({
|
||||
@@ -127,20 +218,17 @@ export default {
|
||||
that.dataTable=res.data;
|
||||
})
|
||||
},
|
||||
submit(formName){
|
||||
submit(){
|
||||
var _this=this;
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
|
||||
//调用方法提交
|
||||
if(this.form.adminName!==''|| this.form.adminPassword!==''){
|
||||
axios({
|
||||
method: 'post',
|
||||
// 请求的地址
|
||||
url: 'http://localhost:8082/helloGithub_war_exploded/adminRegister',
|
||||
// URL 中的查询参数
|
||||
params: {
|
||||
adminname: this.login.username,
|
||||
password: this.login.password,
|
||||
adminname: this.form.adminName,
|
||||
password: this.form.adminPassword,
|
||||
}
|
||||
}).then(function (res) {
|
||||
if (res.data.code === 200) {
|
||||
@@ -150,6 +238,7 @@ export default {
|
||||
type: 'success',
|
||||
offset: 50
|
||||
});
|
||||
_this.isEdit=true;
|
||||
_this.dialogVisible=false;
|
||||
_this.getAllAdmin();
|
||||
} else {
|
||||
@@ -161,9 +250,13 @@ export default {
|
||||
}
|
||||
});
|
||||
}else {
|
||||
return false;
|
||||
}
|
||||
Vue.prototype.$notify.error({
|
||||
title: '提示',
|
||||
message: '请填写相关信息',
|
||||
offset: 50
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
resetImg() {
|
||||
this.imageUrl = "http://localhost:8082/helloGithub_war_exploded/VerifycodeServlet?" + new Date().getTime();
|
||||
@@ -172,19 +265,20 @@ export default {
|
||||
this.$refs[formName].resetFields();
|
||||
},
|
||||
addAdmin(){
|
||||
this.modalType=0;
|
||||
this.dialogVisible=true;
|
||||
},
|
||||
handleEdit(index) {
|
||||
console.log(index);
|
||||
this.modalType = 1;
|
||||
|
||||
this.addAdmin();
|
||||
this.dialogVisible=true;
|
||||
// 深拷贝
|
||||
this.form = index;
|
||||
|
||||
},
|
||||
// 删除按钮
|
||||
handleDelete(index) {
|
||||
var that=this;
|
||||
this.$confirm('此操作将永久删除该用户, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
@@ -193,26 +287,26 @@ export default {
|
||||
axios({
|
||||
method: 'post',
|
||||
// 请求的地址
|
||||
url: 'http://localhost:8082/helloGithub_war_exploded/adminRegister',
|
||||
url: 'http://localhost:8082/helloGithub_war_exploded/deleteAdmin',
|
||||
// URL 中的查询参数
|
||||
params: {
|
||||
id: index.id,
|
||||
adminId: index.adminId,
|
||||
}
|
||||
}).then(function (res) {
|
||||
if (res.data.code === 200) {
|
||||
if (res.data.code === 500) {
|
||||
Vue.prototype.$notify.error({
|
||||
title: '错误',
|
||||
message: res.data.msg,
|
||||
offset: 50
|
||||
});
|
||||
} else {
|
||||
Vue.prototype.$notify({
|
||||
title: '成功',
|
||||
message: ('i', {style: 'color: teal'}, res.data.msg),
|
||||
type: 'success',
|
||||
offset: 50
|
||||
});
|
||||
|
||||
} else {
|
||||
Vue.prototype.$notify.error({
|
||||
title: '错误',
|
||||
message: res.data.msg,
|
||||
offset: 50
|
||||
});
|
||||
that.getAllAdmin();
|
||||
}
|
||||
|
||||
});
|
||||
@@ -226,9 +320,13 @@ export default {
|
||||
},
|
||||
closeDialog() {
|
||||
// 先重置
|
||||
this.form={}
|
||||
this.getAllAdmin();
|
||||
// 后关闭
|
||||
this.dialogVisible = false
|
||||
this.dialogVisible = false;
|
||||
this.isEdit=true;
|
||||
},
|
||||
editForm(){
|
||||
this.isEdit=false;
|
||||
},
|
||||
}
|
||||
}
|
||||
|
@@ -64,6 +64,7 @@
|
||||
:inactive-value="0"
|
||||
active-color="#13ce66"
|
||||
inactive-color="#ff4949"
|
||||
@change="handleChangeStatus($event,scope.row.userId)"
|
||||
>
|
||||
</el-switch>
|
||||
</template>
|
||||
@@ -84,40 +85,45 @@
|
||||
<el-dialog title="编辑" :visible.sync="dialogVisible" width="26%"
|
||||
append-to-body
|
||||
:close-on-click-modal="false"
|
||||
:before-close="closeDialog"
|
||||
>
|
||||
<el-form ref="ruleForm" class="login_container" :model="form" status-icon label-width="70px">
|
||||
<el-form-item label="ID" prop="username">
|
||||
<el-input v-model="form.userId" placeholder='ID' clearable disabled></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="用户名" prop="username">
|
||||
<el-input v-model="form.userName" placeholder='用户名' clearable></el-input>
|
||||
<el-input v-model="form.userName" placeholder='用户名' clearable :disabled="isEdit"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="密 码" prop="password">
|
||||
<el-input type="password" v-model="form.userPassword"
|
||||
:disabled="isEdit"
|
||||
placeholder='请输入密码'
|
||||
clearable></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="项目数" prop="projectNum">
|
||||
<el-input v-model="form.projectNum" placeholder='项目数量' clearable></el-input>
|
||||
<el-input v-model="form.projectNum" placeholder='项目数量' clearable :disabled="isEdit"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="贡献值" prop="contributionValue">
|
||||
<el-input v-model="form.contributionValue" placeholder='贡献值' clearable></el-input>
|
||||
<el-input v-model="form.contributionValue" placeholder='贡献值' clearable :disabled="isEdit"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="等级" prop="userLevel">
|
||||
<el-input v-model="form.userLevel" placeholder='用户等级' clearable></el-input>
|
||||
<el-input v-model="form.userLevel" placeholder='用户等级' clearable :disabled="isEdit"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="搜索历史" prop="searchHistory">
|
||||
<el-input v-model="form.searchHistory" placeholder='搜索历史' clearable></el-input>
|
||||
<el-input v-model="form.searchHistory" placeholder='搜索历史' clearable :disabled="isEdit"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="头像" prop="userAvatar">
|
||||
<el-input v-model="form.userAvatar" placeholder='头像' clearable></el-input>
|
||||
<el-input v-model="form.userAvatar" placeholder='头像' clearable :disabled="isEdit"></el-input>
|
||||
<template slot-scope="scope">
|
||||
<img :src="'http://localhost:8082/helloGithub_war_exploded/retUserAv?username='+scope.row.username" />
|
||||
</template>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否有效" prop="isValid">
|
||||
<el-radio-group v-model="form.isValid">
|
||||
<el-radio-group v-model="form.isValid" :disabled="isEdit">
|
||||
<el-radio :label="1">有效</el-radio>
|
||||
<el-radio :label="0">无效</el-radio>
|
||||
</el-radio-group>
|
||||
@@ -125,8 +131,8 @@
|
||||
|
||||
<el-form-item>
|
||||
<div style="display: flex;flex-direction: row;align-items: center;flex-wrap: nowrap;justify-content: space-between">
|
||||
<el-button @click="resetForm('ruleForm')">重置</el-button>
|
||||
<el-button @click="submit('ruleForm')" type="primary" style=";margin-top:10px">提交</el-button>
|
||||
<el-button @click="editForm()">编辑</el-button>
|
||||
<el-button @click="submit('ruleForm')" type="primary" style=";margin-top:10px">保存</el-button>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@@ -145,6 +151,7 @@ export default {
|
||||
data(){
|
||||
return {
|
||||
dataTable:[],
|
||||
isEdit:true,
|
||||
dialogVisible:false,
|
||||
form:{
|
||||
userId:'',
|
||||
@@ -164,6 +171,89 @@ export default {
|
||||
this.getAllUser();
|
||||
},
|
||||
methods:{
|
||||
editForm(){
|
||||
this.isEdit=false;
|
||||
},
|
||||
closeDialog() {
|
||||
// 先重置
|
||||
this.getAllUser();
|
||||
// 后关闭
|
||||
this.dialogVisible = false;
|
||||
this.isEdit=true;
|
||||
},
|
||||
handleChangeStatus($event, id){
|
||||
if ($event === 1) { // 这里判断一下
|
||||
// 启用
|
||||
this.$confirm('确认启用吗?', '操作确认', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(async () => {
|
||||
axios({
|
||||
method: 'post',
|
||||
// 请求的地址
|
||||
url: 'http://localhost:8082/helloGithub_war_exploded/updateisValid_user',
|
||||
// URL 中的查询参数
|
||||
params: {
|
||||
userId:id,
|
||||
isValid:$event
|
||||
}
|
||||
}).then(function (res) {
|
||||
if (res.data.code === 200) {
|
||||
Vue.prototype.$notify({
|
||||
title: '成功',
|
||||
message: ('i', {style: 'color: teal'}, res.data.msg),
|
||||
type: 'success',
|
||||
offset: 50
|
||||
});
|
||||
} else {
|
||||
Vue.prototype.$notify.error({
|
||||
title: '错误',
|
||||
message: res.data.msg,
|
||||
offset: 50
|
||||
});
|
||||
}
|
||||
})
|
||||
})
|
||||
.catch(() => {})
|
||||
} else {
|
||||
// 禁用
|
||||
this.$confirm('确认禁用吗?', '操作确认', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(async () => {
|
||||
axios({
|
||||
method: 'post',
|
||||
// 请求的地址
|
||||
url: 'http://localhost:8082/helloGithub_war_exploded/updateisValid_user',
|
||||
// URL 中的查询参数
|
||||
params: {
|
||||
userId:id,
|
||||
isValid:$event
|
||||
}
|
||||
}).then(function (res) {
|
||||
if (res.data.code === 200) {
|
||||
Vue.prototype.$notify({
|
||||
title: '成功',
|
||||
message: ('i', {style: 'color: teal'}, res.data.msg),
|
||||
type: 'success',
|
||||
offset: 50
|
||||
});
|
||||
} else {
|
||||
Vue.prototype.$notify.error({
|
||||
title: '错误',
|
||||
message: res.data.msg,
|
||||
offset: 50
|
||||
});
|
||||
}
|
||||
})
|
||||
})
|
||||
.catch(() => {})
|
||||
}
|
||||
},
|
||||
getAllUser(){
|
||||
var that=this;
|
||||
axios({
|
||||
@@ -212,6 +302,7 @@ export default {
|
||||
});
|
||||
|
||||
} else {
|
||||
_this.isEdit=true;
|
||||
_this.dialogVisible = false;
|
||||
_this.getAllUser();
|
||||
Vue.prototype.$notify({
|
||||
|
@@ -6,7 +6,7 @@
|
||||
<el-avatar v-if="this.$cookie.get('username')!==null" shape="square" style=" cursor: pointer;box-shadow: 0 2px 4px rgba(0, 0, 0, .12), 0 0 6px rgba(0, 0, 0, .04)" :src="'http://localhost:8082/helloGithub_war_exploded/retUserAv?username='+this.$cookie.get('username')" size="large">{{this.$cookie.get('username')}}</el-avatar>
|
||||
<div style="margin-left: 5px;display: flex;flex-direction: column;justify-content: space-evenly">
|
||||
<span style="cursor: pointer;font-weight: bold">{{this.$cookie.get('username')}}</span>
|
||||
<span style="cursor: pointer;font-weight: 800;font-size: 13px;color: #3b82f6">Lv.{{userLevel}}</span>
|
||||
<span style="display: flex;justify-content: flex-start;cursor: pointer;font-weight: 800;font-size: 13px;color: #3b82f6">Lv.{{userLevel}}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@@ -231,7 +231,6 @@ export default {
|
||||
that.commentList=JSON.parse(res.data.comment);
|
||||
that.like=JSON.parse(res.data.like)
|
||||
that.article=JSON.parse(res.data.article);
|
||||
// console.log(that.commentList);
|
||||
});
|
||||
},
|
||||
updateUserLevel(){
|
||||
|
@@ -1,10 +1,10 @@
|
||||
<template>
|
||||
<el-card style="border-radius: 15px;margin-top: 10px">
|
||||
<div style="cursor: pointer;display: flex;flex-direction: row;flex-wrap: nowrap">
|
||||
<!-- <div style="display: flex;align-items: center">-->
|
||||
<!-- <span style="font-size: 16px;font-weight: bold">●</span>-->
|
||||
<!-- </div>-->
|
||||
<div @click="toProjectDetail" class="userProjects" style=";margin-left:10px;display: flex;flex-direction: column;flex-wrap: nowrap">
|
||||
<div @click="toProjectDetail" class="userProjects" style="cursor: pointer;display: flex;flex-direction: row;flex-wrap: nowrap">
|
||||
<div style="width: 80px;height: 80px;display: flex;align-items: center">
|
||||
<el-avatar :size="80" :src="project.projectIco" shape="square"></el-avatar>
|
||||
</div>
|
||||
<div style=";margin-left:10px;display: flex;flex-direction: column;flex-wrap: nowrap">
|
||||
<div style="margin-left: 10px;display: flex;flex-direction: row;justify-content: flex-start">
|
||||
<span style="font-size: 16px;font-weight: bold">{{project.projectName}}</span>
|
||||
</div>
|
||||
@@ -19,7 +19,10 @@
|
||||
<span style="margin-left: 5px;font-size: 14px;color: #9ca3af">●</span>
|
||||
<span style="margin-left: 5px;font-size: 14px;color: #9ca3af">{{ formatNumber(project.lookCount) }}</span>
|
||||
<span style="margin-left: 5px;font-size: 14px;color: #9ca3af">●</span>
|
||||
<span style="margin-left: 5px;font-size: 14px;color: #9ca3af">{{project.submitTime}}</span>
|
||||
<span style="margin-left: 5px;font-size: 14px;color: #9ca3af">{{project.submitTime}}
|
||||
</span><span style="margin-left: 5px;font-size: 14px;color: #9ca3af">●</span>
|
||||
<span v-show="project.isValid===0" style="margin-left: 5px;font-size: 14px;color: #ffca00">待审核</span>
|
||||
<span v-show="project.isValid===1" style="margin-left: 5px;font-size: 14px;color: #48d04e">已通过</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -54,7 +57,7 @@ export default {
|
||||
},
|
||||
computed:{
|
||||
brief:function(){
|
||||
return this.project.projectDescription.substr(0, 43) + '...';
|
||||
return this.project.projectDescription.substr(0, 45) + '...';
|
||||
},
|
||||
},
|
||||
methods:{
|
||||
|
Reference in New Issue
Block a user