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`, categoryFind: `/iasf/categoryService/Category/findById`,
categoryList: `/iasf/categoryService/Category/list`, categoryList: `/iasf/categoryService/Category/list`,
categorySave: `/iasf/categoryService/Category/saveOrUpdate`, categorySave: `/iasf/categoryService/Category/saveOrUpdate`,
categoryCheck: `/iasf/categoryService/Category/checkDelete`,
productDetailsSave: `/iasf/productDetails/saveOrUpdate`, productDetailsSave: `/iasf/productDetails/saveOrUpdate`,
productDetailsFind: `/iasf/productDetails/findById`, productDetailsFind: `/iasf/productDetails/findById`,

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

@ -22,7 +22,12 @@
<i class="el-icon-picture-outline"></i> <i class="el-icon-picture-outline"></i>
</div> </div>
</template> </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> <div v-else v-html="scope.row[item.prop]"></div>
</template> </template>
</el-table-column> </el-table-column>
@ -264,7 +269,7 @@ export default {
]), ]),
// form // form
handleForm () { 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' if (!this.data.labelWidth) this.data.labelWidth = '70px'
this.fixed = false this.fixed = false
if (type === 'form' || type === 'forms') { if (type === 'form' || type === 'forms') {
@ -310,6 +315,18 @@ export default {
} }
this.articleNums = nums 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) form && form.site && this.siteChange(form.site)
this.dialogWidth = dialogWidth || '1000px' this.dialogWidth = dialogWidth || '1000px'
if (labelWidth) this.labelWidth = labelWidth if (labelWidth) this.labelWidth = labelWidth
@ -420,9 +437,13 @@ export default {
this.$set(row, item.type === 'video' ? 'video' : 'pic', res.url) this.$set(row, item.type === 'video' ? 'video' : 'pic', res.url)
this.$set(row, 'mediaType', res.original.substr(res.original.lastIndexOf('.') + 1)) this.$set(row, 'mediaType', res.original.substr(res.original.lastIndexOf('.') + 1))
this.$set(row, 'fileName', res.original) this.$set(row, 'fileName', res.original)
this.fileList = [{
name: res.original,
url: res.url
}]
} }
}, },
beforeRemove (file, fileList) { beforeRemove (file) {
return this.$confirm(`确定移除 ${file.name}`); return this.$confirm(`确定移除 ${file.name}`);
}, },
handleRemove (file, fileList, form, prop) { handleRemove (file, fileList, form, prop) {

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

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

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

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

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

@ -11,6 +11,22 @@
<el-form-item prop="description" label="SEO描述"> <el-form-item prop="description" label="SEO描述">
<el-input type="textarea" placeholder="SEO标题" v-model="form.description" clearable :rows="7"></el-input> <el-input type="textarea" placeholder="SEO标题" v-model="form.description" clearable :rows="7"></el-input>
</el-form-item> </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> </el-form>
<div class="text-center"> <div class="text-center">
<el-button type="primary" @click="submit">保存</el-button> <el-button type="primary" @click="submit">保存</el-button>
@ -19,15 +35,22 @@
</template> </template>
<script> <script>
import Util from '@/libs/util' import Util from '@/libs/util'
import Setting from "@/setting"
export default { export default {
data () { data () {
return { return {
siteId: this.$store.state.content.site.id, siteId: this.$store.state.content.site.id,
headers: {
token: Util.local.get(Setting.tokenKey)
},
fileList: [],
form: { form: {
siteId: this.$store.state.content.site.id, siteId: this.$store.state.content.site.id,
title: '', title: '',
keyword: '', keyword: '',
description: '', description: '',
iconSuffix: '',
iconUrl: '',
}, },
rules: { rules: {
title: [ title: [
@ -66,6 +89,39 @@ export default {
if (data.length) this.form = data[0] if (data.length) this.form = data[0]
}).catch(err => { }) }).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 () { submit () {
this.$refs.form.validate((valid) => { this.$refs.form.validate((valid) => {
@ -93,4 +149,8 @@ export default {
width: 940px; width: 940px;
} }
} }
.icon {
max-height: 32px;
}
</style> </style>
Loading…
Cancel
Save