mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-ui.git
synced 2025-12-17 16:35:53 +08:00
批量上传、添加注释
This commit is contained in:
@@ -63,7 +63,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
editor: null, // 富文本编辑器初始化
|
||||
data: this.value, // 富文本数据
|
||||
data: '', // 富文本数据
|
||||
dataEdit: "", // 编辑数据
|
||||
showHTMLModal: false, // 显示html
|
||||
full: false, // html全屏开关
|
||||
@@ -185,12 +185,10 @@ export default {
|
||||
if (!editor) {
|
||||
this.initEditor();
|
||||
}
|
||||
if (value && value != this.data) {
|
||||
this.data = value;
|
||||
editor.txt.html(this.data);
|
||||
this.$emit("input", this.data);
|
||||
this.$emit("on-change", this.data);
|
||||
}
|
||||
this.data = value;
|
||||
editor.txt.html(this.data);
|
||||
this.$emit("input", this.data);
|
||||
this.$emit("on-change", this.data);
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
|
||||
@@ -11,15 +11,15 @@
|
||||
:readonly="readonly"
|
||||
:maxlength="maxlength"
|
||||
>
|
||||
<Button slot="append" icon="md-eye"></Button>
|
||||
<Poptip slot="append" transfer trigger="hover" title="图片预览" placement="right" width="350">
|
||||
<Icon type="md-eye" class="see-icon" />
|
||||
<div slot="content">
|
||||
<img :src="currentValue" alt="该资源不存在" style="width: 100%;margin: 0 auto;display: block;" />
|
||||
<a @click="viewImage=true" style="margin-top:5px;text-align:right;display:block">查看大图</a>
|
||||
</div>
|
||||
</Poptip>
|
||||
</Input>
|
||||
<Poptip transfer trigger="hover" title="图片预览" placement="right" width="350">
|
||||
<Icon type="md-eye" class="see-icon" />
|
||||
<div slot="content">
|
||||
<img :src="currentValue" alt="该资源不存在" style="width: 100%;margin: 0 auto;display: block;" />
|
||||
<a @click="viewImage=true" style="margin-top:5px;text-align:right;display:block">查看大图</a>
|
||||
</div>
|
||||
</Poptip>
|
||||
|
||||
<Upload
|
||||
:action="uploadFileUrl"
|
||||
:headers="accessToken"
|
||||
@@ -35,7 +35,7 @@
|
||||
ref="up"
|
||||
class="upload"
|
||||
>
|
||||
<Button :loading="loading" :size="size" :disabled="disabled" :icon="icon">上传图片</Button>
|
||||
<Button :loading="loading" :size="size" :disabled="disabled">上传图片</Button>
|
||||
</Upload>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<Row>
|
||||
<Col style=" height: 100%;" span="4">
|
||||
<Card class="article-category">
|
||||
<Tree :data="treeData" @on-select-change="handleSearchChange"></Tree>
|
||||
<Tree :data="treeData" @on-select-change="handleCateChange"></Tree>
|
||||
</Card>
|
||||
</Col>
|
||||
<Col span="20">
|
||||
@@ -18,9 +18,9 @@
|
||||
</Form>
|
||||
</Row>
|
||||
<Row class="operation padding-row">
|
||||
<Button @click="add" type="primary" style="">添加</Button>
|
||||
<Button @click="add" type="primary">添加</Button>
|
||||
</Row>
|
||||
<Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom" @on-sort-change="changeSort" @on-selection-change="changeSelect">
|
||||
<Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom" @on-selection-change="changeSelect">
|
||||
<!-- 页面展示 -->
|
||||
<template slot="openStatusSlot" slot-scope="scope">
|
||||
<div>
|
||||
@@ -57,7 +57,7 @@
|
||||
<Input type="number" v-model="form.sort" clearable style="width: 10%" />
|
||||
</FormItem>
|
||||
<FormItem class="form-item-view-el" label="文章内容" prop="content">
|
||||
<editor openXss v-model="form.content"></editor>
|
||||
<editor openXss v-model="form.content"></editor>
|
||||
</FormItem>
|
||||
<FormItem label="是否展示" prop="openStatus">
|
||||
<i-switch size="large" v-model="form.openStatus" :true-value="open" :false-value="close">
|
||||
@@ -154,28 +154,7 @@ export default {
|
||||
title: "是否显示",
|
||||
key: "openStatus",
|
||||
width: 100,
|
||||
slot: "openStatusSlot",
|
||||
/*render: (h, params) => {
|
||||
if (params.row.openStatus == "CLOSE") {
|
||||
return h("div", [
|
||||
h("Badge", {
|
||||
props: {
|
||||
status: "error",
|
||||
text: "隐藏",
|
||||
},
|
||||
}),
|
||||
]);
|
||||
} else if (params.row.openStatus == "OPEN") {
|
||||
return h("div", [
|
||||
h("Badge", {
|
||||
props: {
|
||||
status: "success",
|
||||
text: "展示",
|
||||
},
|
||||
}),
|
||||
]);
|
||||
}
|
||||
},*/
|
||||
slot: "openStatusSlot"
|
||||
},
|
||||
{
|
||||
title: "排序",
|
||||
@@ -266,11 +245,13 @@ export default {
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
// 初始化数据
|
||||
init() {
|
||||
this.getDataList();
|
||||
this.getAllList(0);
|
||||
},
|
||||
handleSearchChange(data) {
|
||||
// 选择分类回调
|
||||
handleCateChange(data) {
|
||||
let { value, title } = data[0];
|
||||
this.list.push({
|
||||
value,
|
||||
@@ -279,7 +260,7 @@ export default {
|
||||
this.searchForm.categoryId = value;
|
||||
this.searchTreeValue = title;
|
||||
},
|
||||
//是否展示事件
|
||||
//是否展示文章
|
||||
changeSwitch(v) {
|
||||
let params = {
|
||||
status: v.openStatus,
|
||||
@@ -290,6 +271,7 @@ export default {
|
||||
}
|
||||
});
|
||||
},
|
||||
// 文章分类的选择事件
|
||||
handleCheckChange(data) {
|
||||
let value = "";
|
||||
let title = "";
|
||||
@@ -307,36 +289,33 @@ export default {
|
||||
this.form.categoryId = value;
|
||||
this.treeValue = title;
|
||||
},
|
||||
// 改变页数
|
||||
changePage(v) {
|
||||
this.searchForm.pageNumber = v;
|
||||
this.getDataList();
|
||||
this.clearSelectAll();
|
||||
},
|
||||
// 改变页码
|
||||
changePageSize(v) {
|
||||
this.searchForm.pageSize = v;
|
||||
this.getDataList();
|
||||
},
|
||||
// 搜索列表
|
||||
handleSearch() {
|
||||
this.searchForm.pageNumber = 1;
|
||||
this.searchForm.pageSize = 10;
|
||||
this.getDataList();
|
||||
},
|
||||
changeSort(e) {
|
||||
this.searchForm.sort = e.key;
|
||||
this.searchForm.order = e.order;
|
||||
if (e.order === "normal") {
|
||||
this.searchForm.order = "";
|
||||
}
|
||||
this.getDataList();
|
||||
},
|
||||
// 取消全选
|
||||
clearSelectAll() {
|
||||
this.$refs.table.selectAll(false);
|
||||
},
|
||||
// 列表选择回调
|
||||
changeSelect(e) {
|
||||
this.selectList = e;
|
||||
this.selectCount = e.length;
|
||||
},
|
||||
|
||||
// 获取全部文章分类
|
||||
getAllList(parent_id) {
|
||||
this.loading = true;
|
||||
getArticleCategory(parent_id).then((res) => {
|
||||
@@ -353,6 +332,7 @@ export default {
|
||||
}
|
||||
});
|
||||
},
|
||||
// 文章分类格式化方法
|
||||
getTree(tree = []) {
|
||||
let arr = [];
|
||||
if (!!tree && tree.length !== 0) {
|
||||
@@ -369,6 +349,7 @@ export default {
|
||||
}
|
||||
return arr;
|
||||
},
|
||||
// 获取文章列表
|
||||
getDataList(val) {
|
||||
if (val) this.form = {};
|
||||
this.loading = true;
|
||||
@@ -387,7 +368,7 @@ export default {
|
||||
this.total = this.data.length;
|
||||
this.loading = false;
|
||||
},
|
||||
|
||||
// 添加文章
|
||||
handleSubmit() {
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
@@ -417,16 +398,26 @@ export default {
|
||||
}
|
||||
});
|
||||
},
|
||||
// 添加文章modal
|
||||
add() {
|
||||
this.modalType = 0;
|
||||
this.modalTitle = "添加文章";
|
||||
this.treeValue = '';
|
||||
this.form = {
|
||||
content:''
|
||||
};
|
||||
this.$refs.form.resetFields();
|
||||
delete this.form.id;
|
||||
this.modalVisible = true;
|
||||
},
|
||||
// 编辑文章modal
|
||||
edit(data) {
|
||||
this.modalType = 1;
|
||||
this.modalTitle = "编辑文章";
|
||||
this.treeValue = '';
|
||||
this.form = {
|
||||
content:''
|
||||
};
|
||||
this.$refs.form.resetFields();
|
||||
|
||||
seeArticle(data.id).then((res) => {
|
||||
|
||||
@@ -145,7 +145,7 @@ export default {
|
||||
if (this.id) {
|
||||
this.getCoupon()
|
||||
} else {
|
||||
this.$refs.form.resetFiles()
|
||||
this.$refs.form.resetFields()
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -13,8 +13,6 @@
|
||||
:data="data"
|
||||
ref="table"
|
||||
sortable="custom"
|
||||
@on-sort-change="changeSort"
|
||||
@on-selection-change="changeSelect"
|
||||
>
|
||||
<!-- 商品栏目格式化 -->
|
||||
<template slot="imageSlot" slot-scope="scope">
|
||||
@@ -53,8 +51,6 @@
|
||||
:data="data"
|
||||
ref="table"
|
||||
sortable="custom"
|
||||
@on-sort-change="changeSort"
|
||||
@on-selection-change="changeSelect"
|
||||
>
|
||||
<!-- 商品栏目格式化 -->
|
||||
<template slot="imageSlot" slot-scope="scope">
|
||||
@@ -99,7 +95,7 @@
|
||||
/>
|
||||
</FormItem>
|
||||
<FormItem label="图片" prop="resource">
|
||||
<Input v-model="form.resource" clearable style="width: 100%" />
|
||||
<upload-pic-input v-model="form.resource" style="width: 100%"></upload-pic-input>
|
||||
</FormItem>
|
||||
<FormItem label="类型" prop="type">
|
||||
<radio-group v-model="form.type" type="button">
|
||||
@@ -119,15 +115,16 @@
|
||||
</template>
|
||||
<script>
|
||||
import * as API_Setting from "@/api/setting";
|
||||
|
||||
import uploadPicInput from "@/views/my-components/lili/upload-pic-input";
|
||||
export default {
|
||||
components: {
|
||||
uploadPicInput,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
modalVisible: false, //添加验证码源弹出框
|
||||
modalTitle: "", //添加验证码源弹出框标题
|
||||
loading: true, // 表单加载状态
|
||||
selectList: [], // 多选数据
|
||||
selectCount: 0, // 多选计数
|
||||
modalType: 0, // 添加或编辑标识
|
||||
submitLoading: false, // 添加或编辑提交状态
|
||||
form: {
|
||||
@@ -250,11 +247,6 @@ export default {
|
||||
this.searchForm.pageSize = v;
|
||||
this.getDataList();
|
||||
},
|
||||
changeSort(e) {
|
||||
this.searchForm.sort = e.key;
|
||||
this.searchForm.order = e.order;
|
||||
this.getDataList();
|
||||
},
|
||||
//切换tab
|
||||
handleClickType(v) {
|
||||
this.searchForm.pageNumber = 1; // 当前页数
|
||||
@@ -281,15 +273,12 @@ export default {
|
||||
});
|
||||
this.loading = false;
|
||||
},
|
||||
changeSelect(e) {
|
||||
this.selectList = e;
|
||||
this.selectCount = e.length;
|
||||
},
|
||||
//添加验证码源
|
||||
add() {
|
||||
this.form.type = this.searchForm.type;
|
||||
this.modalVisible = true;
|
||||
this.modalType = 0;
|
||||
this.$refs.form.resetFields()
|
||||
this.modalTitle = "添加验证码源";
|
||||
},
|
||||
//修改验证码源
|
||||
|
||||
Reference in New Issue
Block a user