增加资料排序,notify修改为message
This commit is contained in:
parent
e8685e804c
commit
e868df3a4b
|
@ -212,12 +212,7 @@ export default {
|
|||
updateCompany(this.company.id, this.company).then(() => {
|
||||
this.getList();
|
||||
this.dialogVisible = false;
|
||||
this.$notify({
|
||||
title: "成功",
|
||||
message: "编辑成功",
|
||||
type: "success",
|
||||
duration: 2000
|
||||
});
|
||||
this.$message.success('成功')
|
||||
});
|
||||
} else {
|
||||
createCompany(this.company).then(res => {
|
||||
|
@ -225,12 +220,7 @@ export default {
|
|||
// this.tableData.unshift(this.company)
|
||||
this.getList();
|
||||
this.dialogVisible = false;
|
||||
this.$notify({
|
||||
title: "成功",
|
||||
message: "新增成功",
|
||||
type: "success",
|
||||
duration: 2000
|
||||
});
|
||||
this.$message.success('成功')
|
||||
});
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -156,11 +156,7 @@ export default {
|
|||
|
||||
const { description, name } = this.role
|
||||
this.dialogVisible = false
|
||||
this.$notify({
|
||||
title: '成功',
|
||||
dangerouslyUseHTMLString: true,
|
||||
type: 'success'
|
||||
})
|
||||
this.$message.success('成功')
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
@ -43,10 +43,13 @@
|
|||
<span v-else>{{ scope.row.name }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="header-center" label="类型">
|
||||
<el-table-column label="类型">
|
||||
<template slot-scope="scope">{{ scope.row.type }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="header-center" label="上传时间">
|
||||
<el-table-column align="header-center" label="排序码">
|
||||
<template slot-scope="scope">{{ scope.row.sort }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="上传时间">
|
||||
<template slot-scope="scope">{{ scope.row.create_time }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="header-center" label="下载量/播放量">
|
||||
|
@ -96,6 +99,9 @@
|
|||
<el-form-item label="描述" prop="description">
|
||||
<el-input v-model="material.description" placeholder="描述" />
|
||||
</el-form-item>
|
||||
<el-form-item label="排序" prop="description">
|
||||
<el-input-number v-model="material.sort" :min="1"></el-input-number>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="封面" prop="poster" v-if="material.type=='视频'">
|
||||
<el-upload
|
||||
accept=".png, .jpeg, .jpg"
|
||||
|
@ -334,12 +340,7 @@ export default {
|
|||
if (res.code >= 200) {
|
||||
this.getList();
|
||||
this.dialogVisible = false;
|
||||
this.$notify({
|
||||
title: "成功",
|
||||
message: "编辑成功",
|
||||
type: "success",
|
||||
duration: 2000,
|
||||
});
|
||||
this.$message.success('成功')
|
||||
}
|
||||
});
|
||||
} else {
|
||||
|
@ -347,10 +348,7 @@ export default {
|
|||
.then((res) => {
|
||||
this.getList();
|
||||
this.dialogVisible = false;
|
||||
this.$notify({
|
||||
title: "成功",
|
||||
type: "success",
|
||||
});
|
||||
this.$message.success('成功')
|
||||
})
|
||||
.catch((error) => {});
|
||||
}
|
||||
|
|
|
@ -229,12 +229,7 @@ export default {
|
|||
() => {
|
||||
this.getList();
|
||||
this.dialogVisible = false;
|
||||
this.$notify({
|
||||
title: "成功",
|
||||
message: "编辑成功",
|
||||
type: "success",
|
||||
duration: 2000
|
||||
});
|
||||
this.$message.success('成功')
|
||||
}
|
||||
);
|
||||
} else {
|
||||
|
@ -243,12 +238,7 @@ export default {
|
|||
// this.tableData.unshift(this.questioncat)
|
||||
this.getList();
|
||||
this.dialogVisible = false;
|
||||
this.$notify({
|
||||
title: "成功",
|
||||
message: "新增成功",
|
||||
type: "success",
|
||||
duration: 2000
|
||||
});
|
||||
this.$message.success('成功')
|
||||
});
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -155,12 +155,7 @@ export default {
|
|||
() => {
|
||||
this.getList();
|
||||
this.dialogVisible = false;
|
||||
this.$notify({
|
||||
title: "成功",
|
||||
message: "编辑成功",
|
||||
type: "success",
|
||||
duration: 2000
|
||||
});
|
||||
this.$message.success('成功')
|
||||
}
|
||||
);
|
||||
} else {
|
||||
|
@ -169,12 +164,7 @@ export default {
|
|||
// this.tableData.unshift(this.subject)
|
||||
this.getList();
|
||||
this.dialogVisible = false;
|
||||
this.$notify({
|
||||
title: "成功",
|
||||
message: "新增成功",
|
||||
type: "success",
|
||||
duration: 2000
|
||||
});
|
||||
this.$message.success('成功')
|
||||
});
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -201,12 +201,7 @@ export default {
|
|||
updateBanner(this.banner.id, this.banner).then(() => {
|
||||
this.getList();
|
||||
this.dialogVisible = false;
|
||||
this.$notify({
|
||||
title: "成功",
|
||||
message: "编辑成功",
|
||||
type: "success",
|
||||
duration: 2000
|
||||
});
|
||||
this.$message.success('成功')
|
||||
});
|
||||
} else {
|
||||
createBanner(this.banner).then(res => {
|
||||
|
@ -214,12 +209,7 @@ export default {
|
|||
// this.tableData.unshift(this.banner)
|
||||
this.getList();
|
||||
this.dialogVisible = false;
|
||||
this.$notify({
|
||||
title: "成功",
|
||||
message: "新增成功",
|
||||
type: "success",
|
||||
duration: 2000
|
||||
});
|
||||
this.$message.success('成功')
|
||||
});
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -180,12 +180,7 @@ export default {
|
|||
updateOrg(this.org.id, this.org).then(() => {
|
||||
this.getList();
|
||||
this.dialogVisible = false;
|
||||
this.$notify({
|
||||
title: "成功",
|
||||
message: "编辑成功",
|
||||
type: "success",
|
||||
duration: 2000
|
||||
});
|
||||
this.$message.success('成功')
|
||||
});
|
||||
} else {
|
||||
this.org.pid = this.org.pid.pop()
|
||||
|
@ -194,12 +189,7 @@ export default {
|
|||
// this.tableData.unshift(this.org)
|
||||
this.getList();
|
||||
this.dialogVisible = false;
|
||||
this.$notify({
|
||||
title: "成功",
|
||||
message: "新增成功",
|
||||
type: "success",
|
||||
duration: 2000
|
||||
});
|
||||
this.$message.success('成功')
|
||||
});
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -377,12 +377,7 @@ export default {
|
|||
}
|
||||
}
|
||||
this.dialogVisible = false;
|
||||
this.$notify({
|
||||
title: "成功",
|
||||
message: "编辑成功",
|
||||
type: "success",
|
||||
duration: 2000
|
||||
});
|
||||
this.$message.success('成功')
|
||||
});
|
||||
} else {
|
||||
this.user.department = this.user.department.pop();
|
||||
|
@ -391,12 +386,7 @@ export default {
|
|||
// this.userList.unshift(this.user)
|
||||
this.getList();
|
||||
this.dialogVisible = false;
|
||||
this.$notify({
|
||||
title: "成功",
|
||||
message: "新增成功",
|
||||
type: "success",
|
||||
duration: 2000
|
||||
});
|
||||
this.$message.success('成功')
|
||||
});
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
# Generated by Django 3.0.4 on 2021-03-13 03:09
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('cms', '0007_auto_20200811_0835'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='material',
|
||||
name='sort',
|
||||
field=models.IntegerField(default=1, verbose_name='排序码'),
|
||||
),
|
||||
]
|
|
@ -37,4 +37,5 @@ class Material(CommonModel):
|
|||
poster = models.CharField(max_length=10000, verbose_name='封面地址', null=True, blank=True)
|
||||
type = models.CharField('格式', default='文档', max_length=50)
|
||||
down_count = models.IntegerField('阅读量', default=0)
|
||||
sort = models.IntegerField('排序码', default=1)
|
||||
|
||||
|
|
|
@ -68,7 +68,7 @@ class MaterialViewSet(ModelViewSet):
|
|||
filter_backends = [DjangoFilterBackend,SearchFilter, OrderingFilter]
|
||||
search_fields = ['name','description']
|
||||
ordering_fields = ['update_time', 'down_count']
|
||||
ordering = ['-down_count']
|
||||
ordering = ['sort', '-down_count']
|
||||
filterset_fields = ['type', 'name']
|
||||
|
||||
@action(methods=['get'], detail=True, url_name='down_material', perms_map=[{'*':'down_material'}])
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
# Generated by Django 3.0.4 on 2021-03-13 03:09
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('crm', '0025_auto_20201013_1024'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='consumer',
|
||||
name='ID_number',
|
||||
field=models.CharField(blank=True, max_length=100, null=True, verbose_name='查询身份证号'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='consumer',
|
||||
name='realname',
|
||||
field=models.CharField(blank=True, max_length=100, null=True, verbose_name='查询真实姓名'),
|
||||
),
|
||||
]
|
|
@ -1,13 +0,0 @@
|
|||
from sympy import *
|
||||
a1 = Symbol('a1')
|
||||
a2 = Symbol('a2')
|
||||
a3 = Symbol('a3')
|
||||
b1 = Symbol('b1')
|
||||
b2 = Symbol('b2')
|
||||
r = solve([
|
||||
a1+a2-40,
|
||||
b1+b2-10,
|
||||
2*a1+4*b1-60,
|
||||
2*a2+4*b2-40
|
||||
], [a1,a2,b1,b2])
|
||||
print(r)
|
Loading…
Reference in New Issue