Commit fa754bfa by chenyu

update: update

parent 30eb18e6
......@@ -45,7 +45,7 @@
</template>
<script>
import requestApi from '@/api/operation';
const { activityCategoryGetList, activityCategoryUpdate } = requestApi;
const { activityGetList, activityCategoryGetList, activityCategoryUpdate } = requestApi;
import draggable from 'vuedraggable';
export default {
name: 'CategoryDialog',
......@@ -121,7 +121,12 @@ export default {
}
});
},
onDeleteItem(idx) {
async onDeleteItem(idx) {
// activityGetList
const { result = [] } = await activityGetList({ activityCategoryId: this.list[ idx ].activityCategoryId });
if (Array.isArray(result) && result.length) {
return this.$message.error('该分类有活动在引用,不可删除!');
}
this.list.splice(idx, 1);
delete this.nameMap[this.list[ idx ].categoryName];
},
......
......@@ -77,11 +77,10 @@ export default {
methods: {
getTableHeader() {
this.tableHeader = [
{ label: '活动分类', prop: 'activityCategoryId', width: '120', formatter: ({ activityCategoryId = '' }) => (activityCategoryId ? this.categoryFilter[ activityCategoryId ] : '--') },
{ label: '活动分类', prop: 'activityCategoryId', width: '120', formatter: ({ activityCategoryId = '' }) => ( this.categoryFilter[ activityCategoryId ] ? this.categoryFilter[ activityCategoryId ] : '--') },
{ label: '活动名称', prop: 'activityName', 'min-width': '100' },
{ label: '活动说明', prop: 'activityExplain', 'min-width': '100' },
{ label: '标签文案', prop: 'activityRemark', 'min-width': '50' },
{ label: '跳转路径', prop: 'jumpUrl', 'min-width': '100' },
{ label: '排序号', prop: 'activitySort', width: '100' },
{ label: '活动图片', prop: 'activityImage', width: '100', isImage: true },
{
......
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