Commit f2da41cd authored by shida.liu's avatar shida.liu

feat: 生成链接上增加vccChannel

parent 174bfa4f
...@@ -9,218 +9,228 @@ ...@@ -9,218 +9,228 @@
</QGTable> </QGTable>
</template> </template>
<script> <script>
import editorApi from '@api/editor.api'; import editorApi from "@api/editor.api";
import QGTable from '@editor/component/QgTable/index.vue'; import QGTable from "@editor/component/QgTable/index.vue";
import config from '@/config/index'; import config from "@/config/index";
export default { export default {
components: { components: {
QGTable, QGTable,
}, },
data(){ data() {
return { return {
columns: [ columns: [
{ {
key: 'id', key: "id",
title: '编号', title: "编号",
formType: 'input', formType: "input",
hideSearch: true hideSearch: true,
}, },
{ {
key: 'pageName', key: "pageName",
title: '名称', title: "名称",
formType: 'input', formType: "input",
}, },
{ {
key: 'pageDescribe', key: "pageDescribe",
title: '描述', title: "描述",
formType: 'input', formType: "input",
},
{
key: "uuid",
title: "uuid",
formType: "input",
hideTable: true,
},
{
key: "author",
title: "作者",
formType: "input",
},
{
key: "coverImage",
title: "封面",
hideSearch: true,
render: (h, params) => {
return h(
"div",
{
style: {
textAlign: "left",
display: "flex",
alignItems: "center",
justifyContent: "center",
padding: "10px 0",
},
},
[
h("img", {
attrs: {
src:
params.row.coverImage +
"?imageMogr2/format/jpg/thumbnail/!10p",
},
style: {
width: "37.5px",
height: "66.7px",
objectFit: "contain",
},
}),
]
);
}, },
{ },
key: 'uuid', {
title: 'uuid', key: "id",
formType: 'input', title: "链接",
hideTable: true, hideSearch: true,
render: (h, params) => {
return h(
"span",
`${config.h5Host}/activity/${params.row.uuid}?tenantId=${params.row.tenantId}&vccToken={token}&appChannel={appChannel}&vccChannel={registerFrom}`
);
}, },
{ },
key: 'author', {
title: '作者', key: "isTemplate",
formType: 'input', title: "是否模板",
formType: "select",
number: true,
hideSearch: true,
valueEnum: {
0: "",
1: "",
}, },
{ },
key: 'coverImage', {
title: '封面', key: "updatedAt",
hideSearch: true, title: "更新时间",
render: (h, params) => { hideSearch: true,
return h( },
'div', {
key: "action",
title: "操作",
width: 250,
render: (h, params) => {
const props = {
type: "primary",
};
const style = {
display: "inline-block",
margin: "5px",
};
const btnArr = [
h(
"Button",
{ {
props,
style: { style: {
textAlign: 'left', ...style,
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
padding: '10px 0'
}, },
}, on: {
[h( click: () => {
'img',{ window.open(
attrs: { `${config.h5Host}/activity/${params.row.uuid}?tenantId=${params.row.tenantId}&isPreview=1`
src: params.row.coverImage + '?imageMogr2/format/jpg/thumbnail/!10p', );
},
style: {
width: '37.5px',
height: '66.7px',
objectFit: 'contain'
}
}
)]
);
},
},
{
key: 'id',
title: '链接',
hideSearch: true,
render: (h, params) => {
return h('span', `${config.h5Host}/activity/${params.row.uuid}?tenantId=${params.row.tenantId}&vccToken={token}&appChannel={appChannel}`)
}
},
{
key: 'isTemplate',
title: '是否模板',
formType: 'select',
number: true,
hideSearch: true,
valueEnum: {
0: '',
1: '',
}
},
{
key: 'updatedAt',
title: '更新时间',
hideSearch: true
},
{
key: 'action',
title: '操作',
width: 250,
render: (h, params) => {
const props = {
type: 'primary',
};
const style = {
display: 'inline-block',
margin: '5px',
};
const btnArr = [
h(
'Button',
{
props,
style: {
...style,
},
on: {
click: () => {
window.open(`${config.h5Host}/activity/${params.row.uuid}?tenantId=${params.row.tenantId}&isPreview=1`);
},
}, },
}, },
'预览' },
), "预览"
h( ),
'Button', h(
{ "Button",
props, {
style: { props,
...style, style: {
}, ...style,
on: {
click: () => {
console.log(params);
this.$router.push(`/detail/${params.row.uuid}`);
},
},
}, },
'修改' on: {
), click: () => {
h( console.log(params);
'Button', this.$router.push(`/detail/${params.row.uuid}`);
{
props,
style: {
...style,
display: params.row.pageHistory && params.row.pageHistory.length ? 'inline-block' : 'none'
},
on: {
click: () => {
this.$refs.qgTable.showRecords(params.row.pageHistory);
},
}, },
}, },
'历史记录' },
), "修改"
h( ),
'Poptip', h(
{ "Button",
props: { {
confirm: true, props,
transfer: true, style: {
title: '确认删除?', ...style,
}, display:
style: { params.row.pageHistory && params.row.pageHistory.length
...style, ? "inline-block"
}, : "none",
on: { },
'on-ok': async () => { on: {
await editorApi.delPageById(params.row.id); click: () => {
this.$refs.qgTable.query(); this.$refs.qgTable.showRecords(params.row.pageHistory);
},
}, },
}, },
[ },
h( "历史记录"
'Button', ),
{ h(
props, "Poptip",
},
'删除'
),
]
),
];
return h(
'div',
{ {
props: {
confirm: true,
transfer: true,
title: "确认删除?",
},
style: { style: {
textAlign: 'center', ...style,
},
on: {
"on-ok": async () => {
await editorApi.delPageById(params.row.id);
this.$refs.qgTable.query();
},
}, },
}, },
btnArr [
); h(
}, "Button",
{
props,
},
"删除"
),
]
),
];
return h(
"div",
{
style: {
textAlign: "center",
},
},
btnArr
);
}, },
], },
} ],
};
},
methods: {
async query(data) {
return editorApi.getPageList({ type: "list", ...data });
}, },
methods: { addPage() {
async query(data) { this.$router.push("/detail");
return editorApi.getPageList({ type: 'list', ...data }); },
}, async refreshData() {
addPage() { try {
this.$router.push('/detail'); await editorApi.refreshCache();
}, this.$Notice.success({ title: "刷新成功!" });
async refreshData() { } catch (error) {
try { console.log(error);
await editorApi.refreshCache(); this.$Notice.warning({ title: "刷新失败!" });
this.$Notice.success({ title: '刷新成功!' }); }
} catch (error) {
console.log(error);
this.$Notice.warning({ title: '刷新失败!' });
}
},
}, },
mounted(){} },
} mounted() {},
</script> };
\ No newline at end of file </script>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment