Browse Source

上传最新代码

master
yanghao 3 years ago
parent
commit
c028f0222b
  1. 2
      .env.development
  2. 17
      src/api/Resources.js
  3. 118
      src/views/information/index.vue
  4. 4
      src/views/shop/demandHall/authentication.vue
  5. 153
      src/views/shop/demandHall/index.vue
  6. 4
      src/views/shop/goods/form.vue
  7. 6
      src/views/shop/goods/index.vue
  8. 2
      vue.config.js

2
.env.development

@ -1,7 +1,7 @@
ENV = 'development' ENV = 'development'
# 接口地址 # 接口地址
VUE_APP_BASE_API = 'http://192.168.1.34:8094' VUE_APP_BASE_API = 'http://192.168.68.126:8094'
VUE_APP_WS_API = 'ws://localhost:8088' VUE_APP_WS_API = 'ws://localhost:8088'
# 是否启用 babel-plugin-dynamic-import-node插件 # 是否启用 babel-plugin-dynamic-import-node插件

17
src/api/Resources.js

@ -1,4 +1,5 @@
import request from '@/utils/request' import request from '@/utils/request'
import qs from 'qs'
export function add(data) { export function add(data) {
return request({ return request({
@ -24,4 +25,18 @@ export function edit(data) {
}) })
} }
export default { add, edit, del } export function getResourceList(data) {
return request({
url: 'api/Resources/listResource'+ '?' + qs.stringify(data, { indices: false }),
method: 'get'
})
}
export function examineResources(data) {
return request({
url: 'api/Resources/examineResources',
method: 'post',
data
})
}
export default { add, edit, del, getResourceList }

118
src/views/information/index.vue

@ -14,6 +14,14 @@
</router-link> </router-link>
</div> </div>
</div> </div>
<el-tabs v-model="articleCatetoryId">
<el-tab-pane
:label="item.name"
:name="item.id+''"
v-for="item in articleCatetoryList"
:key="item.id">
</el-tab-pane>
</el-tabs>
<!--表单组件--> <!--表单组件-->
<!--<eForm ref="form" :is-add="isAdd" />--> <!--<eForm ref="form" :is-add="isAdd" />-->
<!--表格渲染--> <!--表格渲染-->
@ -23,35 +31,70 @@
<el-table-column prop="author" label="作者" /> <el-table-column prop="author" label="作者" />
<el-table-column ref="table" prop="imageInput" label="封面"> <el-table-column ref="table" prop="imageInput" label="封面">
<template slot-scope="scope"> <template slot-scope="scope">
<a :href="scope.row.imageInput" style="color: #42b983" target="_blank"><img :src="scope.row.imageInput" alt="点击打开" class="el-avatar"></a> <a :href="scope.row.imageInput" style="color: #42b983" target="_blank">
<el-image style="width: 60px; height: 60px" :src="scope.row.imageInput" alt="点击打开" fit="cover"></el-image>
</a>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :show-overflow-tooltip="true" prop="createTime" label="是否热门"> <el-table-column :show-overflow-tooltip="true" label="是否热门">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag type="info" v-if="scope.row.isHot == 0"></el-tag> <el-popover
<el-tag type="success" v-if="scope.row.isHot == 1"></el-tag> :ref="'hot'+scope.row.id"
placement="top"
width="180"
>
<p>{{scope.row.isHot == 0 ? '是否确认设置为热门?' : '是否确认取消热门?'}}</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="$refs['hot'+scope.row.id].doClose()">取消</el-button>
<el-button :loading="setLoading" type="primary" size="mini" @click="recommendClick(scope.row,'hot')">确定</el-button>
</div>
<el-tag
:type="scope.row.isHot == 0 ? 'danger' : 'success'"
slot="reference"
>
{{scope.row.isHot == 0 ? '否' : '是'}}
</el-tag>
</el-popover>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :show-overflow-tooltip="true" prop="createTime" label="是否推荐"> <el-table-column :show-overflow-tooltip="true" label="是否推荐">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag type="info" v-if="scope.row.isRecommend == 0"></el-tag> <el-popover
<el-tag type="success" v-if="scope.row.isRecommend == 1"></el-tag> :ref="'popover'+scope.row.id"
placement="top"
width="180"
>
<p>{{scope.row.isRecommend == 0 ? '是否确认设置为推荐?' : '是否确认取消推荐?'}}</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="$refs['popover'+scope.row.id].doClose()">取消</el-button>
<el-button :loading="setLoading" type="primary" size="mini" @click="recommendClick(scope.row,'recommend')">确定</el-button>
</div>
<el-tag
:type="scope.row.isRecommend == 0 ? 'danger' : 'success'"
style="cursor:pointer;"
slot="reference"
>
{{scope.row.isRecommend == 0 ? '否' : '是'}}
</el-tag>
</el-popover>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :show-overflow-tooltip="true" prop="createTime" label="创建日期"> <el-table-column :show-overflow-tooltip="true" label="创建日期">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.createTime }}</span> <span>{{ scope.row.createTime }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column v-if="checkPermission(['admin','YXARTICLE_ALL','YXARTICLE_EDIT','YXARTICLE_DELETE'])" label="操作" width="220px" align="center"> <el-table-column v-if="checkPermission(['admin','YXARTICLE_ALL','YXARTICLE_EDIT','YXARTICLE_DELETE'])" label="操作" width="220px" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button v-permission="['admin','YXARTICLE_ALL','YXARTICLE_EDIT']" size="mini"
type="primary" icon="el-icon-edit"
>
<router-link :to="'/information/form/'+scope.row.id"> <router-link :to="'/information/form/'+scope.row.id">
编辑 <el-button
</router-link> v-permission="['admin','YXARTICLE_ALL','YXARTICLE_EDIT']"
size="mini"
type="primary" icon="el-icon-edit"
> 编辑
</el-button> </el-button>
</router-link>
<el-popover <el-popover
:ref="scope.row.id" :ref="scope.row.id"
v-permission="['admin','YXARTICLE_ALL','YXARTICLE_DELETE']" v-permission="['admin','YXARTICLE_ALL','YXARTICLE_DELETE']"
@ -96,7 +139,7 @@
<script> <script>
import checkPermission from '@/utils/permission' import checkPermission from '@/utils/permission'
import initData from '@/mixins/crud' import initData from '@/mixins/crud'
import { del, publish } from '@/api/yxArticle' import { del, publish, edit } from '@/api/yxArticle'
import eForm from './form' import eForm from './form'
import { formatTime } from '@/utils/index' import { formatTime } from '@/utils/index'
export default { export default {
@ -104,7 +147,10 @@ export default {
mixins: [initData], mixins: [initData],
data() { data() {
return { return {
delLoading: false delLoading: false,
articleCatetoryId: null,
articleCatetoryList: [],
setLoading: false
} }
}, },
created() { created() {
@ -112,13 +158,47 @@ export default {
this.init() this.init()
}) })
}, },
mounted(){
this.getArticleCatetory()
},
watch: {
articleCatetoryId(newVal,oldVal){
this.init()
},
},
methods: { methods: {
//
getArticleCatetory(){
this.$http('api/articleCatetory').then((res)=>{
this.articleCatetoryList = res.content.reverse()
this.articleCatetoryId = res.content[0].id + ''
})
},
//
recommendClick(row, type){
this.setLoading = true
type == 'hot' ? row.isHot = row.isHot == 0 ? 1 : 0 : row.isRecommend = row.isRecommend == 0 ? 1 : 0
edit(row).then((res)=>{
type == 'hot' ? this.$refs['hot'+row.id].doClose() : this.$refs['popover'+row.id].doClose()
this.setLoading = false
this.$notify({
title: '修改成功',
type: 'success',
duration: 2500
})
})
},
formatTime, formatTime,
checkPermission, checkPermission,
beforeInit() { beforeInit() {
this.url = 'api/yxArticle' this.url = 'api/yxArticle'
const sort = 'id,desc' const sort = 'id,desc'
this.params = { page: this.page, size: this.size, sort: sort } this.params = {
page: this.page,
size: this.size,
sort: sort,
cid: this.articleCatetoryId
}
return true return true
}, },
subDelete(id) { subDelete(id) {
@ -196,6 +276,8 @@ export default {
} }
</script> </script>
<style scoped> <style>
.cell .el-tag{
cursor: pointer;
}
</style> </style>

4
src/views/shop/demandHall/authentication.vue

@ -40,7 +40,7 @@
<el-table-column prop="authorizationPath" label="授权申请书"> <el-table-column prop="authorizationPath" label="授权申请书">
<template slot-scope="scope"> <template slot-scope="scope">
<a :href="scope.row.authorizationPath" style="color: #42b983" target="_blank"> <a :href="scope.row.authorizationPath" style="color: #42b983" target="_blank">
<img :src="scope.row.authorizationPath" alt="点击打开" class="el-avatar2"> <el-image :src="scope.row.authorizationPath" alt="点击打开" class="el-avatar2" fit="cover"></el-image>
</a> </a>
</template> </template>
</el-table-column> </el-table-column>
@ -51,7 +51,7 @@
<el-table-column prop="businessLicense" label="营业执照"> <el-table-column prop="businessLicense" label="营业执照">
<template slot-scope="scope"> <template slot-scope="scope">
<a :href="scope.row.businessLicense" style="color: #42b983" target="_blank"> <a :href="scope.row.businessLicense" style="color: #42b983" target="_blank">
<img :src="scope.row.businessLicense" alt="点击打开" class="el-avatar2"> <el-image :src="scope.row.businessLicense" alt="点击打开" class="el-avatar2" fit="cover"></el-image>
</a> </a>
</template> </template>
</el-table-column> </el-table-column>

153
src/views/shop/demandHall/index.vue

@ -1,7 +1,7 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<!--工具栏--> <!--工具栏-->
<div class="head-container"> <!-- <div class="head-container">
<div class="search-box"> <div class="search-box">
<el-select v-model="resourceType" clearable placeholder="资源类型"> <el-select v-model="resourceType" clearable placeholder="资源类型">
<el-option <el-option
@ -20,7 +20,12 @@
</el-option> </el-option>
</el-select> </el-select>
<el-button type="primary" @click="search">搜索</el-button> <el-button type="primary" @click="search">搜索</el-button>
</div> </div> -->
<el-tabs v-model="resourceAuditState" type="card" @tab-click="search">
<el-tab-pane label="待审核" name="1"></el-tab-pane>
<el-tab-pane label="审核通过" name="2"></el-tab-pane>
<el-tab-pane label="审核不通过" name="3"></el-tab-pane>
</el-tabs>
<!--表格渲染--> <!--表格渲染-->
<el-table ref="table" v-loading="loading" :data="data" size="small" style="width: 100%;"> <el-table ref="table" v-loading="loading" :data="data" size="small" style="width: 100%;">
<el-table-column prop="id" label="id" /> <el-table-column prop="id" label="id" />
@ -35,12 +40,14 @@
</el-table-column> </el-table-column>
<el-table-column prop="resourceAuditState" label="审核状态"> <el-table-column prop="resourceAuditState" label="审核状态">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{scope.row.resourceAuditState == 1 ? '待审核' : scope.row.resourceAuditState == 2 ? '审核通过' : '审核未通过'}}</span> <el-tag type="" v-if="scope.row.resourceAuditState == 1">待审核</el-tag>
<el-tag type="success" v-if="scope.row.resourceAuditState == 2">审核通过</el-tag>
<el-tag type="danger" v-if="scope.row.resourceAuditState == 3">审核未通过</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" width="150px" align="center"> <el-table-column label="操作" width="150px" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="showDialog(scope.row)">审核</el-button> <el-button size="mini" type="primary" @click="showDialog(scope.row)">审核</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -80,118 +87,90 @@
</template> </template>
<script> <script>
import crudResource from '@/api/Resources.js' import crudResource from "@/api/Resources.js";
// crudpresenter // crudpresenter
export default { export default {
name: 'Resource', name: "Resource",
data() { data() {
return { return {
loading: true, loading: false,
data: [], data: [],
typeOptions:[
{
value: 1,
label: '资源'
},
{
value: 2,
label: '需求'
}
],
stateOptions:[
{
value: 1,
label: '审核中'
},
{
value: 2,
label: '审核通过'
},
{
value: 3,
label: '审核不通过'
}
],
// resourceCagetoryId: 0,
// enterpriseType: 0,
// resourceAuditState: [1],
// resourceType: 0,
resourceCagetoryId: null, resourceCagetoryId: null,
enterpriseType: null, enterpriseType: null,
resourceAuditState: null, resourceAuditState: '1',
resourceType: null, resourceType: null,
total: 0, total: 0,
page: 1, page: 1,
size: 10, size: 10,
dialogVisible:false, dialogVisible: false,
authForm:{type: 1,reason: ''} authForm: { type: 1, reason: "" },
} };
}, },
created(){ created() {
this.getList() this.getList();
}, },
methods: { methods: {
stateChange(e){ stateChange(e) {
this.resourceAuditState = [e] this.resourceAuditState = [e];
}, },
handleSizeChange(val){ handleSizeChange(val) {
this.size = val this.size = val;
this.getList() this.getList();
}, },
handleCurrentChange(val){ handleCurrentChange(val) {
this.page = val this.page = val;
this.getList() this.getList();
}, },
search(){ search() {
this.page = 1 this.page = 1;
this.getList() this.getList();
}, },
getList(){ getList() {
this.loading = true
let params = { let params = {
resourceAuditState: this.resourceAuditState, resourceAuditState: this.resourceAuditState,
resourceType: this.resourceType, resourceType: this.resourceType,
resourceCagetoryId: this.resourceCagetoryId, resourceCagetoryId: this.resourceCagetoryId,
enterpriseType:this.enterpriseType, enterpriseType: this.enterpriseType,
page: this.page - 1, page: this.page - 1,
size: this.size size: this.size,
} };
crudResource.getResourceList(params).then((res)=>{ crudResource.getResourceList(params).then((res) => {
this.data = res.content this.data = res.content;
this.loading = false this.loading = false;
this.total = res.totalElements this.total = res.totalElements;
}) });
}, },
showDialog(row){ showDialog(row) {
console.log(row) console.log(row);
this.dialogVisible = true this.dialogVisible = true;
row.resourceAuditState == 2 ? this.authForm.type = 1 : this.authForm.type = 0 row.resourceAuditState == 2
this.authForm.examineId = row.id ? (this.authForm.type = 1)
: (this.authForm.type = 0);
this.authForm.examineId = row.id;
}, },
radioChange(val){ radioChange(val) {
if(val == 1){ if (val == 1) {
this.authForm.reason = '' this.authForm.reason = "";
} }
}, },
authSubmit(){ authSubmit() {
crudResource.examineResources(this.authForm).then((res)=>{ crudResource.examineResources(this.authForm).then((res) => {
this.$message({ this.$message({
message: '操作成功!', message: "操作成功!",
type: 'success' type: "success",
}) });
this.dialogVisible = false this.dialogVisible = false;
this.getList() this.getList();
}) });
} },
} },
} };
</script> </script>
<style scoped> <style scoped>
.table-img { .table-img {
display: inline-block; display: inline-block;
text-align: center; text-align: center;
background: #ccc; background: #ccc;
@ -203,8 +182,8 @@ export default {
width: 32px; width: 32px;
height: 32px; height: 32px;
line-height: 32px; line-height: 32px;
} }
.el-pagination{ .el-pagination {
margin-top: 20px; margin-top: 20px;
} }
</style> </style>

4
src/views/shop/goods/form.vue

@ -9,14 +9,14 @@
<el-input v-model="formValidate.store_name" placeholder="请输入商品名称" /> <el-input v-model="formValidate.store_name" placeholder="请输入商品名称" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- <el-col v-bind="grid2"> <el-col v-bind="grid2">
<el-form-item label="商品分类:" prop="cate_id"> <el-form-item label="商品分类:" prop="cate_id">
<el-select v-model="formValidate.cate_id" filterable :filter-method="dataFilter" clearable> <el-select v-model="formValidate.cate_id" filterable :filter-method="dataFilter" clearable>
<el-option v-for="item in optionsMetaShow" :disabled="item.disabled === 0" <el-option v-for="item in optionsMetaShow" :disabled="item.disabled === 0"
:value="item.value" :key="item.id" :label="item.label" ></el-option> :value="item.value" :key="item.id" :label="item.label" ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> --> </el-col>
<el-col v-bind="grid2"> <el-col v-bind="grid2">
<el-form-item label="商品关键字:" prop=""> <el-form-item label="商品关键字:" prop="">
<el-input v-model="formValidate.keyword" placeholder="请输入商品关键字" /> <el-input v-model="formValidate.keyword" placeholder="请输入商品关键字" />

6
src/views/shop/goods/index.vue

@ -40,12 +40,14 @@
<el-table-column prop="id" label="商品id" /> <el-table-column prop="id" label="商品id" />
<el-table-column ref="table" prop="image" label="商品图片"> <el-table-column ref="table" prop="image" label="商品图片">
<template slot-scope="scope"> <template slot-scope="scope">
<a :href="scope.row.image" style="color: #42b983" target="_blank"><img :src="scope.row.image" alt="点击打开" class="el-avatar"></a> <a :href="scope.row.image" style="color: #42b983" target="_blank">
<el-image :src="scope.row.image" alt="点击打开" style="width:35px;height:35px;" fit="contain"></el-image>
</a>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="storeDto.name" label="发布者" /> <el-table-column prop="storeDto.name" label="发布者" />
<el-table-column prop="storeName" label="商品名称" /> <el-table-column prop="storeName" label="商品名称" />
<!-- <el-table-column prop="storeCategory.cateName" label="分类名称" /> --> <el-table-column prop="storeCategory.cateName" label="分类名称" />
<el-table-column prop="price" label="商品价格" /> <el-table-column prop="price" label="商品价格" />
<el-table-column prop="sales" label="销量" /> <el-table-column prop="sales" label="销量" />
<el-table-column prop="stock" label="库存" /> <el-table-column prop="stock" label="库存" />

2
vue.config.js

@ -22,7 +22,7 @@ module.exports = {
warnings: false, warnings: false,
errors: true errors: true
}, },
disableHostCheck:true, disableHostCheck: true,
proxy: { proxy: {
'/api': { '/api': {
target: process.env.VUE_APP_BASE_API, target: process.env.VUE_APP_BASE_API,

Loading…
Cancel
Save