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. 117
      src/views/shop/demandHall/index.vue
  6. 4
      src/views/shop/goods/form.vue
  7. 6
      src/views/shop/goods/index.vue

2
.env.development

@ -1,7 +1,7 @@
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'
# 是否启用 babel-plugin-dynamic-import-node插件

17
src/api/Resources.js

@ -1,4 +1,5 @@
import request from '@/utils/request'
import qs from 'qs'
export function add(data) {
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>
</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" />-->
<!--表格渲染-->
@ -23,35 +31,70 @@
<el-table-column prop="author" label="作者" />
<el-table-column ref="table" prop="imageInput" label="封面">
<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>
</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">
<el-tag type="info" v-if="scope.row.isHot == 0"></el-tag>
<el-tag type="success" v-if="scope.row.isHot == 1"></el-tag>
<el-popover
: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>
</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">
<el-tag type="info" v-if="scope.row.isRecommend == 0"></el-tag>
<el-tag type="success" v-if="scope.row.isRecommend == 1"></el-tag>
<el-popover
: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>
</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">
<span>{{ scope.row.createTime }}</span>
</template>
</el-table-column>
<el-table-column v-if="checkPermission(['admin','YXARTICLE_ALL','YXARTICLE_EDIT','YXARTICLE_DELETE'])" label="操作" width="220px" align="center">
<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>
<el-button
v-permission="['admin','YXARTICLE_ALL','YXARTICLE_EDIT']"
size="mini"
type="primary" icon="el-icon-edit"
> 编辑
</el-button>
</router-link>
<el-popover
:ref="scope.row.id"
v-permission="['admin','YXARTICLE_ALL','YXARTICLE_DELETE']"
@ -96,7 +139,7 @@
<script>
import checkPermission from '@/utils/permission'
import initData from '@/mixins/crud'
import { del, publish } from '@/api/yxArticle'
import { del, publish, edit } from '@/api/yxArticle'
import eForm from './form'
import { formatTime } from '@/utils/index'
export default {
@ -104,7 +147,10 @@ export default {
mixins: [initData],
data() {
return {
delLoading: false
delLoading: false,
articleCatetoryId: null,
articleCatetoryList: [],
setLoading: false
}
},
created() {
@ -112,13 +158,47 @@ export default {
this.init()
})
},
mounted(){
this.getArticleCatetory()
},
watch: {
articleCatetoryId(newVal,oldVal){
this.init()
},
},
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,
checkPermission,
beforeInit() {
this.url = 'api/yxArticle'
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
},
subDelete(id) {
@ -196,6 +276,8 @@ export default {
}
</script>
<style scoped>
<style>
.cell .el-tag{
cursor: pointer;
}
</style>

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

@ -40,7 +40,7 @@
<el-table-column prop="authorizationPath" label="授权申请书">
<template slot-scope="scope">
<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>
</template>
</el-table-column>
@ -51,7 +51,7 @@
<el-table-column prop="businessLicense" label="营业执照">
<template slot-scope="scope">
<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>
</template>
</el-table-column>

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

@ -1,7 +1,7 @@
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<!-- <div class="head-container">
<div class="search-box">
<el-select v-model="resourceType" clearable placeholder="资源类型">
<el-option
@ -20,7 +20,12 @@
</el-option>
</el-select>
<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-column prop="id" label="id" />
@ -35,12 +40,14 @@
</el-table-column>
<el-table-column prop="resourceAuditState" label="审核状态">
<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>
</el-table-column>
<el-table-column label="操作" width="150px" align="center">
<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>
</el-table-column>
</el-table>
@ -80,114 +87,86 @@
</template>
<script>
import crudResource from '@/api/Resources.js'
import crudResource from "@/api/Resources.js";
// crudpresenter
export default {
name: 'Resource',
name: "Resource",
data() {
return {
loading: true,
loading: false,
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,
enterpriseType: null,
resourceAuditState: null,
resourceAuditState: '1',
resourceType: null,
total: 0,
page: 1,
size: 10,
dialogVisible: false,
authForm:{type: 1,reason: ''}
}
authForm: { type: 1, reason: "" },
};
},
created() {
this.getList()
this.getList();
},
methods: {
stateChange(e) {
this.resourceAuditState = [e]
this.resourceAuditState = [e];
},
handleSizeChange(val) {
this.size = val
this.getList()
this.size = val;
this.getList();
},
handleCurrentChange(val) {
this.page = val
this.getList()
this.page = val;
this.getList();
},
search() {
this.page = 1
this.getList()
this.page = 1;
this.getList();
},
getList() {
this.loading = true
let params = {
resourceAuditState: this.resourceAuditState,
resourceType: this.resourceType,
resourceCagetoryId: this.resourceCagetoryId,
enterpriseType: this.enterpriseType,
page: this.page - 1,
size: this.size
}
size: this.size,
};
crudResource.getResourceList(params).then((res) => {
this.data = res.content
this.loading = false
this.total = res.totalElements
})
this.data = res.content;
this.loading = false;
this.total = res.totalElements;
});
},
showDialog(row) {
console.log(row)
this.dialogVisible = true
row.resourceAuditState == 2 ? this.authForm.type = 1 : this.authForm.type = 0
this.authForm.examineId = row.id
console.log(row);
this.dialogVisible = true;
row.resourceAuditState == 2
? (this.authForm.type = 1)
: (this.authForm.type = 0);
this.authForm.examineId = row.id;
},
radioChange(val) {
if (val == 1) {
this.authForm.reason = ''
this.authForm.reason = "";
}
},
authSubmit() {
crudResource.examineResources(this.authForm).then((res) => {
this.$message({
message: '操作成功!',
type: 'success'
})
this.dialogVisible = false
this.getList()
})
}
}
}
message: "操作成功!",
type: "success",
});
this.dialogVisible = false;
this.getList();
});
},
},
};
</script>
<style scoped>

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

@ -9,14 +9,14 @@
<el-input v-model="formValidate.store_name" placeholder="请输入商品名称" />
</el-form-item>
</el-col>
<!-- <el-col v-bind="grid2">
<el-col v-bind="grid2">
<el-form-item label="商品分类:" prop="cate_id">
<el-select v-model="formValidate.cate_id" filterable :filter-method="dataFilter" clearable>
<el-option v-for="item in optionsMetaShow" :disabled="item.disabled === 0"
:value="item.value" :key="item.id" :label="item.label" ></el-option>
</el-select>
</el-form-item>
</el-col> -->
</el-col>
<el-col v-bind="grid2">
<el-form-item label="商品关键字:" prop="">
<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 ref="table" prop="image" label="商品图片">
<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>
</el-table-column>
<el-table-column prop="storeDto.name" 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="sales" label="销量" />
<el-table-column prop="stock" label="库存" />

Loading…
Cancel
Save