yujialong 5 months ago
parent c8bad88c91
commit 3177837409
  1. 1
      src/api/index.js
  2. 79
      src/components/modules/link.vue
  3. 27
      src/components/modules/module.vue
  4. 4
      src/const/modules.js
  5. 10
      src/pages/article/add/product.vue
  6. 17
      src/pages/column/add/index.vue
  7. 8
      src/pages/logo/index.vue
  8. 12
      src/pages/nav/index.vue
  9. 60
      src/pages/seo/index.vue

@ -113,6 +113,7 @@ export default {
categoryFind: `/iasf/categoryService/Category/findById`,
categoryList: `/iasf/categoryService/Category/list`,
categorySave: `/iasf/categoryService/Category/saveOrUpdate`,
categoryCheck: `/iasf/categoryService/Category/checkDelete`,
productDetailsSave: `/iasf/productDetails/saveOrUpdate`,
productDetailsFind: `/iasf/productDetails/findById`,

@ -1,16 +1,9 @@
<template>
<!-- 设置链接 -->
<div>
<el-dialog title="设置链接地址"
:visible.sync="visible"
width="500px"
:close-on-click-modal="false"
:before-close="close">
<el-form :model="data"
class="model"
label-width="120px">
<el-form-item prop="connectionType"
label="连接类型">
<el-dialog title="设置链接地址" :visible.sync="visible" width="500px" :close-on-click-modal="false" :before-close="close">
<el-form :model="data" class="model" label-width="120px">
<el-form-item prop="connectionType" label="连接类型">
<el-radio-group v-model="data.connectionType">
<!-- <el-radio :label="0"></el-radio> -->
<el-radio :label="1">站内链接</el-radio>
@ -20,71 +13,45 @@
</el-form-item>
<template v-if="data.connectionType === 1">
<el-form-item label="栏目">
<el-cascader ref="column"
v-model="data.columnId"
:options="columns"
:props="columnProps"
<el-cascader ref="column" v-model="data.columnId" :options="columns" :props="columnProps"
@change="columnChange"></el-cascader>
</el-form-item>
<el-form-item label="文章">
<el-select v-model="data.articleId">
<el-option v-for="item in articles"
:key="item.id"
:label="item.title"
:value="item.id">
<el-option v-for="item in articles" :key="item.id" :label="item.title" :value="item.id">
</el-option>
</el-select>
</el-form-item>
</template>
<el-form-item v-show="data.connectionType === 2"
prop="linkAddress"
label="站外链接">
<el-input placeholder="请输入站外链接"
v-model.trim="data.linkAddress"
clearable></el-input>
<el-form-item v-show="data.connectionType === 2" prop="linkAddress" label="站外链接">
<el-input placeholder="请输入站外链接" v-model.trim="data.linkAddress" clearable></el-input>
</el-form-item>
<template v-if="data.connectionType === 3">
<el-form-item prop="site"
label="站点选择">
<el-select v-model="data.site"
@change="getOtherColumn">
<el-option v-for="item in sites"
:key="item.id"
:label="item.siteName"
:value="item.id">
<el-form-item prop="site" label="站点选择">
<el-select v-model="data.site" @change="getOtherColumn">
<el-option v-for="item in sites" :key="item.id" :label="item.siteName" :value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="栏目">
<el-cascader ref="otherColumn"
v-model="data.otherColumnId"
:options="otherColumns"
:props="columnProps"
<el-cascader ref="otherColumn" v-model="data.otherColumnId" :options="otherColumns" :props="columnProps"
@change="columnChange"></el-cascader>
</el-form-item>
<el-form-item label="文章">
<el-select v-model="data.otherArticleId">
<el-option v-for="item in articles"
:key="item.id"
:label="item.title"
:value="item.id">
<el-option v-for="item in articles" :key="item.id" :label="item.title" :value="item.id">
</el-option>
</el-select>
</el-form-item>
</template>
<el-form-item prop="isOpen"
label="新窗口打开">
<el-switch v-model="data.isOpen"
:active-value="1"
:inactive-value="0">
<el-form-item prop="isOpen" label="新窗口打开">
<el-switch v-model="data.isOpen" :active-value="1" :inactive-value="0">
</el-switch>
</el-form-item>
</el-form>
<span slot="footer"
class="dialog-footer">
<span slot="footer" class="dialog-footer">
<el-button @click="$emit('update:visible', false)">取消</el-button>
<el-button type="primary"
@click="linkSubmit">确定</el-button>
<el-button type="primary" @click="linkSubmit">确定</el-button>
</span>
</el-dialog>
</div>
@ -133,8 +100,6 @@ export default {
//
getList () {
this.$post(this.api.listWithTree, {
siteId: this.site.id,
columnName: '',
templateId: '',
@ -154,13 +119,16 @@ export default {
},
//
columnChange () {
this.data.articleId = ''
this.data[this.data.connectionType === 1 ? 'articleId' : 'otherArticleId'] = ''
this.getArticle()
},
//
getArticle () {
// /
const id = this.data.connectionType === 1 ? this.data.columnId[this.data.columnId.length - 1] : this.data.otherColumnId[this.data.otherColumnId.length - 1]
const isIn = this.data.connectionType === 1 //
const id = isIn ? this.data.columnId[this.data.columnId.length - 1] : this.data.otherColumnId[this.data.otherColumnId.length - 1]
const e = this[isIn ? 'columns' : 'otherColumns'].find(e => e.id === id)
e && this.$set(this.data, 'isProduct', e.templateId === 12 || e.listStyleId === 73 ? 1 : 0)
id && this.$post(this.api.queryArticle, {
siteId: this.data.connectionType === 1 ? this.site.id : this.data.site,
columnIds: [id],
@ -185,8 +153,6 @@ export default {
//
getOtherColumn () {
this.data.site && this.$post(this.api.listWithTree, {
siteId: this.data.site,
columnName: '',
templateId: '',
@ -206,5 +172,4 @@ export default {
}
};
</script>
<style lang="scss" scoped>
</style>
<style lang="scss" scoped></style>

@ -22,7 +22,12 @@
<i class="el-icon-picture-outline"></i>
</div>
</template>
<div v-else-if="item.type === 'editor'" v-html="scope.row[item.prop]"></div>
<template v-else-if="item.type === 'editor'">
<!-- 展示成纯文本 -->
<div v-if="item.pureText">{{ scope.row[item.pureProp] }}</div>
<div v-else v-html="scope.row[item.prop]"></div>
</template>
<div v-else v-html="scope.row[item.prop]"></div>
</template>
</el-table-column>
@ -264,7 +269,7 @@ export default {
]),
// form
handleForm () {
const { type, forms, form, dialogWidth, labelWidth } = this.data
const { type, forms, form, dialogWidth, labelWidth, list } = this.data
if (!this.data.labelWidth) this.data.labelWidth = '70px'
this.fixed = false
if (type === 'form' || type === 'forms') {
@ -310,6 +315,18 @@ export default {
}
this.articleNums = nums
}
if (type === 'introduce') {
forms.map(e => {
if (e.type === 'editor' && e.pureText && list) {
list.map(n => {
console.log(444, n[e.prop])
const el = document.createElement('div')
el.innerHTML = n[e.prop]
n[e.pureProp] = el.innerText
})
}
})
}
form && form.site && this.siteChange(form.site)
this.dialogWidth = dialogWidth || '1000px'
if (labelWidth) this.labelWidth = labelWidth
@ -420,9 +437,13 @@ export default {
this.$set(row, item.type === 'video' ? 'video' : 'pic', res.url)
this.$set(row, 'mediaType', res.original.substr(res.original.lastIndexOf('.') + 1))
this.$set(row, 'fileName', res.original)
this.fileList = [{
name: res.original,
url: res.url
}]
}
},
beforeRemove (file, fileList) {
beforeRemove (file) {
return this.$confirm(`确定移除 ${file.name}`);
},
handleRemove (file, fileList, form, prop) {

@ -461,7 +461,9 @@ export default {
{
type: 'editor',
prop: 'des',
label: '描述'
label: '描述',
pureText: true, // 编辑的时候是富文本,但是外面表格里展示的时候是纯文本(富文本里文字图片过大影响表格展示才需要用此方式)
pureProp: 'pureDes', // 跟pureText绑定的属性,有pureText才会有此字段,用以表格里展示纯文本
},
{
type: 'link',

@ -652,9 +652,10 @@ export default {
this.$set(row, 'edit', 1)
},
//
delClass (row, i) {
async delClass (row, i) {
if (row.categoryId) {
this.$confirm('确定要删除吗?', '提示', {
const { code, msg } = await this.$post(`${this.api.categoryCheck}?categoryId=${row.categoryId}`)
this.$confirm(code === 200 ? '确定要删除吗?' : msg, '提示', {
type: 'warning'
}).then(() => {
this.$post(this.api.categoryDel, [row.categoryId]).then(res => {
@ -731,9 +732,10 @@ export default {
this.$set(row, 'edit', 1)
},
//
delLabel (row, i) {
async delLabel (row, i) {
if (row.categoryId) {
this.$confirm('确定要删除吗?', '提示', {
const { code, msg } = await this.$post(`${this.api.categoryCheck}?categoryId=${row.categoryId}`)
this.$confirm(code === 200 ? '确定要删除吗?' : msg, '提示', {
type: 'warning'
}).then(() => {
this.$post(this.api.categoryDel, [row.categoryId]).then(res => {

@ -55,8 +55,10 @@
<ul class="styles">
<li v-for="(item, i) in listStyle" :key="i" @click="form.listStyleId = item.id">
<div class="review">
<img style="width: 90px;max-height: 110px;" :src="require('@/assets/images/style/' + item.id + '.png')"
alt="">
<el-image style="width: 90px;max-height: 110px;"
:src="require('@/assets/images/style/' + item.id + '.png')"
:preview-src-list="[require('@/assets/images/style/' + item.id + '.png')]">
</el-image>
</div>
<el-radio v-model="form.listStyleId" :label="item.id">{{ item.style }}</el-radio>
</li>
@ -66,8 +68,10 @@
<ul class="styles">
<li v-for="(item, i) in detailStyleId" :key="i" @click="form.detailStyleId = item.id">
<div class="review">
<img :style="{ width: item.id == 24 ? '50px' : '90px', 'max-height': '110px' }"
:src="require('@/assets/images/style/' + item.id + '.png')" alt="">
<el-image :style="{ width: item.id == 24 ? '50px' : '90px', 'max-height': '110px' }"
:src="require('@/assets/images/style/' + item.id + '.png')"
:preview-src-list="[require('@/assets/images/style/' + item.id + '.png')]">
</el-image>
</div>
<el-radio v-model="form.detailStyleId" :label="item.id">{{ item.style }}</el-radio>
</li>
@ -131,7 +135,10 @@
<ul class="styles">
<li v-for="(item, i) in pageStyle" :key="i" @click="form.listStyleId = item.id">
<div class="review">
<img :src="require('@/assets/images/page/' + item.pic + '.png')" alt="">
<el-image style="width: 50px;" :src="require('@/assets/images/page/' + item.pic + '.png')"
:preview-src-list="[require('@/assets/images/page/' + item.pic + '.png')]">
</el-image>
<!-- <img :src="require('@/assets/images/page/' + item.pic + '.png')" alt=""> -->
</div>
<el-radio v-model="form.listStyleId" :label="item.id">{{ item.style }}</el-radio>
</li>

@ -5,8 +5,9 @@
<el-input v-model="form.title" ref="account" placeholder="请输入标题" style="width: 400px"></el-input>
</el-form-item>
<el-form-item label="图标">
<el-upload accept=".jpg,.png,.jpeg" :action="this.api.upload" :on-remove="handleRemove" :on-error="uploadError"
:before-remove="beforeRemove" :headers="headers" :show-file-list="false" :on-success="uploadSuccess">
<el-upload accept=".jpg,.png,.jpeg,.svg" :action="this.api.upload" :on-remove="handleRemove"
:on-error="uploadError" :before-remove="beforeRemove" :headers="headers" :show-file-list="false"
:on-success="uploadSuccess">
<div style="text-align: left;">
<el-button size="small" type="primary">上传logo</el-button>
<div class="m-t-10">
@ -15,7 +16,7 @@
</div>
<div slot="tip" class="el-upload__tip">
<p>只能上传jpg/png文件请上传120*40左右的logo</p>
<p>只能上传jpg/png/svg文件请上传120*40左右的logo</p>
</div>
</el-upload>
</el-form-item>
@ -37,7 +38,6 @@ export default {
token: Util.local.get(Setting.tokenKey)
},
coverUrl: '',
uploadList: [],
form: {
id: '',
title: '',

@ -53,7 +53,7 @@
</div>
</el-form-item>
<el-form-item label="图标">
<el-upload accept=".jpg,.png,.jpeg" :action="this.api.upload" :on-remove="handleRemove"
<el-upload accept=".jpg,.png,.jpeg,.svg" :action="this.api.upload" :on-remove="handleRemove"
:on-error="uploadError" :before-remove="beforeRemove" :headers="headers" :file-list="fileList"
:on-success="res => uploadSuccess(res, 'icon')">
<div style="text-align: left;">
@ -87,7 +87,7 @@
</template>
<el-form-item v-else-if="form.buttonContent === '1'" label="图片">
<el-upload accept=".jpg,.png,.jpeg" :action="this.api.upload" :on-error="uploadError"
<el-upload accept=".jpg,.png,.jpeg,.svg" :action="this.api.upload" :on-error="uploadError"
:before-remove="beforeRemove" :headers="headers" :show-file-list="false"
:on-success="res => uploadSuccess(res, 'imagePath')">
<div style="text-align: left;">
@ -196,10 +196,7 @@ export default {
},
methods: {
getData () {
this.$post(`${this.api.navList}?siteId=${this.siteId}`, {
siteId: this.siteId,
search: this.keyword,
}).then(({ data }) => {
this.$post(`${this.api.navList}?siteId=${this.siteId}&search=${this.keyword}`).then(({ data }) => {
this.list = data
this.listLoading = false
}).catch(err => {
@ -344,7 +341,8 @@ export default {
const result = this.sortColumns.map((e, i) => {
return {
id: e.id,
sortOrder: i + 1
sortOrder: i + 1,
icon: e.icon,
}
})
await this.$post(this.api.navSort, result)

@ -11,6 +11,22 @@
<el-form-item prop="description" label="SEO描述">
<el-input type="textarea" placeholder="SEO标题" v-model="form.description" clearable :rows="7"></el-input>
</el-form-item>
<el-form-item label="网页标题左侧图标">
<el-upload accept=".jpg,.png,.jpeg,.svg,.ico" :action="this.api.upload" :on-remove="handleRemove"
:on-error="uploadError" :before-remove="beforeRemove" :headers="headers" :file-list="fileList"
:on-success="uploadSuccess">
<div style="text-align: left;">
<el-button size="small" type="primary">上传图标</el-button>
<div class="m-t-10">
<img v-if="form.iconUrl" :src="form.iconUrl" class="icon">
</div>
</div>
<div slot="tip" class="el-upload__tip">
<p>只能上传ico/jpg/png/svg文件请上传16*16或者32*32大小的图标</p>
</div>
</el-upload>
</el-form-item>
</el-form>
<div class="text-center">
<el-button type="primary" @click="submit">保存</el-button>
@ -19,15 +35,22 @@
</template>
<script>
import Util from '@/libs/util'
import Setting from "@/setting"
export default {
data () {
return {
siteId: this.$store.state.content.site.id,
headers: {
token: Util.local.get(Setting.tokenKey)
},
fileList: [],
form: {
siteId: this.$store.state.content.site.id,
title: '',
keyword: '',
description: '',
iconSuffix: '',
iconUrl: '',
},
rules: {
title: [
@ -66,6 +89,39 @@ export default {
if (data.length) this.form = data[0]
}).catch(err => { })
},
handleExceed () { //
Util.warningMsg("当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!")
},
//
uploadSuccess (data) {
if (data.code === 401) {
Util.errorMsg("登录过期,请重新登录")
setTimeout(() => {
this.$store.dispatch('user/logout')
}, 1000)
return false
}
this.form.iconSuffix = data.original
this.form.iconUrl = data.url
this.fileList = [{
name: data.original,
url: data.url
}]
},
uploadError (err, file, fileList) {
this.$message({
message: "上传出错,请重试!",
type: "error",
center: true
});
},
beforeRemove (file, fileList) {
return this.$confirm(`确定移除 ${file.name}`);
},
handleRemove () {
this.form.iconSuffix = ''
this.form.iconUrl = ''
},
//
submit () {
this.$refs.form.validate((valid) => {
@ -93,4 +149,8 @@ export default {
width: 940px;
}
}
.icon {
max-height: 32px;
}
</style>
Loading…
Cancel
Save