增加资料排序,notify修改为message
This commit is contained in:
parent
e8685e804c
commit
e868df3a4b
|
@ -212,12 +212,7 @@ export default {
|
||||||
updateCompany(this.company.id, this.company).then(() => {
|
updateCompany(this.company.id, this.company).then(() => {
|
||||||
this.getList();
|
this.getList();
|
||||||
this.dialogVisible = false;
|
this.dialogVisible = false;
|
||||||
this.$notify({
|
this.$message.success('成功')
|
||||||
title: "成功",
|
|
||||||
message: "编辑成功",
|
|
||||||
type: "success",
|
|
||||||
duration: 2000
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
createCompany(this.company).then(res => {
|
createCompany(this.company).then(res => {
|
||||||
|
@ -225,12 +220,7 @@ export default {
|
||||||
// this.tableData.unshift(this.company)
|
// this.tableData.unshift(this.company)
|
||||||
this.getList();
|
this.getList();
|
||||||
this.dialogVisible = false;
|
this.dialogVisible = false;
|
||||||
this.$notify({
|
this.$message.success('成功')
|
||||||
title: "成功",
|
|
||||||
message: "新增成功",
|
|
||||||
type: "success",
|
|
||||||
duration: 2000
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -156,11 +156,7 @@ export default {
|
||||||
|
|
||||||
const { description, name } = this.role
|
const { description, name } = this.role
|
||||||
this.dialogVisible = false
|
this.dialogVisible = false
|
||||||
this.$notify({
|
this.$message.success('成功')
|
||||||
title: '成功',
|
|
||||||
dangerouslyUseHTMLString: true,
|
|
||||||
type: 'success'
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,10 +43,13 @@
|
||||||
<span v-else>{{ scope.row.name }}</span>
|
<span v-else>{{ scope.row.name }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="header-center" label="类型">
|
<el-table-column label="类型">
|
||||||
<template slot-scope="scope">{{ scope.row.type }}</template>
|
<template slot-scope="scope">{{ scope.row.type }}</template>
|
||||||
</el-table-column>
|
</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>
|
<template slot-scope="scope">{{ scope.row.create_time }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="header-center" label="下载量/播放量">
|
<el-table-column align="header-center" label="下载量/播放量">
|
||||||
|
@ -96,6 +99,9 @@
|
||||||
<el-form-item label="描述" prop="description">
|
<el-form-item label="描述" prop="description">
|
||||||
<el-input v-model="material.description" placeholder="描述" />
|
<el-input v-model="material.description" placeholder="描述" />
|
||||||
</el-form-item>
|
</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-form-item label="封面" prop="poster" v-if="material.type=='视频'">
|
||||||
<el-upload
|
<el-upload
|
||||||
accept=".png, .jpeg, .jpg"
|
accept=".png, .jpeg, .jpg"
|
||||||
|
@ -334,12 +340,7 @@ export default {
|
||||||
if (res.code >= 200) {
|
if (res.code >= 200) {
|
||||||
this.getList();
|
this.getList();
|
||||||
this.dialogVisible = false;
|
this.dialogVisible = false;
|
||||||
this.$notify({
|
this.$message.success('成功')
|
||||||
title: "成功",
|
|
||||||
message: "编辑成功",
|
|
||||||
type: "success",
|
|
||||||
duration: 2000,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
@ -347,10 +348,7 @@ export default {
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
this.getList();
|
this.getList();
|
||||||
this.dialogVisible = false;
|
this.dialogVisible = false;
|
||||||
this.$notify({
|
this.$message.success('成功')
|
||||||
title: "成功",
|
|
||||||
type: "success",
|
|
||||||
});
|
|
||||||
})
|
})
|
||||||
.catch((error) => {});
|
.catch((error) => {});
|
||||||
}
|
}
|
||||||
|
|
|
@ -229,12 +229,7 @@ export default {
|
||||||
() => {
|
() => {
|
||||||
this.getList();
|
this.getList();
|
||||||
this.dialogVisible = false;
|
this.dialogVisible = false;
|
||||||
this.$notify({
|
this.$message.success('成功')
|
||||||
title: "成功",
|
|
||||||
message: "编辑成功",
|
|
||||||
type: "success",
|
|
||||||
duration: 2000
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
@ -243,12 +238,7 @@ export default {
|
||||||
// this.tableData.unshift(this.questioncat)
|
// this.tableData.unshift(this.questioncat)
|
||||||
this.getList();
|
this.getList();
|
||||||
this.dialogVisible = false;
|
this.dialogVisible = false;
|
||||||
this.$notify({
|
this.$message.success('成功')
|
||||||
title: "成功",
|
|
||||||
message: "新增成功",
|
|
||||||
type: "success",
|
|
||||||
duration: 2000
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -155,12 +155,7 @@ export default {
|
||||||
() => {
|
() => {
|
||||||
this.getList();
|
this.getList();
|
||||||
this.dialogVisible = false;
|
this.dialogVisible = false;
|
||||||
this.$notify({
|
this.$message.success('成功')
|
||||||
title: "成功",
|
|
||||||
message: "编辑成功",
|
|
||||||
type: "success",
|
|
||||||
duration: 2000
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
@ -169,12 +164,7 @@ export default {
|
||||||
// this.tableData.unshift(this.subject)
|
// this.tableData.unshift(this.subject)
|
||||||
this.getList();
|
this.getList();
|
||||||
this.dialogVisible = false;
|
this.dialogVisible = false;
|
||||||
this.$notify({
|
this.$message.success('成功')
|
||||||
title: "成功",
|
|
||||||
message: "新增成功",
|
|
||||||
type: "success",
|
|
||||||
duration: 2000
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -201,12 +201,7 @@ export default {
|
||||||
updateBanner(this.banner.id, this.banner).then(() => {
|
updateBanner(this.banner.id, this.banner).then(() => {
|
||||||
this.getList();
|
this.getList();
|
||||||
this.dialogVisible = false;
|
this.dialogVisible = false;
|
||||||
this.$notify({
|
this.$message.success('成功')
|
||||||
title: "成功",
|
|
||||||
message: "编辑成功",
|
|
||||||
type: "success",
|
|
||||||
duration: 2000
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
createBanner(this.banner).then(res => {
|
createBanner(this.banner).then(res => {
|
||||||
|
@ -214,12 +209,7 @@ export default {
|
||||||
// this.tableData.unshift(this.banner)
|
// this.tableData.unshift(this.banner)
|
||||||
this.getList();
|
this.getList();
|
||||||
this.dialogVisible = false;
|
this.dialogVisible = false;
|
||||||
this.$notify({
|
this.$message.success('成功')
|
||||||
title: "成功",
|
|
||||||
message: "新增成功",
|
|
||||||
type: "success",
|
|
||||||
duration: 2000
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -180,12 +180,7 @@ export default {
|
||||||
updateOrg(this.org.id, this.org).then(() => {
|
updateOrg(this.org.id, this.org).then(() => {
|
||||||
this.getList();
|
this.getList();
|
||||||
this.dialogVisible = false;
|
this.dialogVisible = false;
|
||||||
this.$notify({
|
this.$message.success('成功')
|
||||||
title: "成功",
|
|
||||||
message: "编辑成功",
|
|
||||||
type: "success",
|
|
||||||
duration: 2000
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.org.pid = this.org.pid.pop()
|
this.org.pid = this.org.pid.pop()
|
||||||
|
@ -194,12 +189,7 @@ export default {
|
||||||
// this.tableData.unshift(this.org)
|
// this.tableData.unshift(this.org)
|
||||||
this.getList();
|
this.getList();
|
||||||
this.dialogVisible = false;
|
this.dialogVisible = false;
|
||||||
this.$notify({
|
this.$message.success('成功')
|
||||||
title: "成功",
|
|
||||||
message: "新增成功",
|
|
||||||
type: "success",
|
|
||||||
duration: 2000
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -377,12 +377,7 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.dialogVisible = false;
|
this.dialogVisible = false;
|
||||||
this.$notify({
|
this.$message.success('成功')
|
||||||
title: "成功",
|
|
||||||
message: "编辑成功",
|
|
||||||
type: "success",
|
|
||||||
duration: 2000
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.user.department = this.user.department.pop();
|
this.user.department = this.user.department.pop();
|
||||||
|
@ -391,12 +386,7 @@ export default {
|
||||||
// this.userList.unshift(this.user)
|
// this.userList.unshift(this.user)
|
||||||
this.getList();
|
this.getList();
|
||||||
this.dialogVisible = false;
|
this.dialogVisible = false;
|
||||||
this.$notify({
|
this.$message.success('成功')
|
||||||
title: "成功",
|
|
||||||
message: "新增成功",
|
|
||||||
type: "success",
|
|
||||||
duration: 2000
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} 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)
|
poster = models.CharField(max_length=10000, verbose_name='封面地址', null=True, blank=True)
|
||||||
type = models.CharField('格式', default='文档', max_length=50)
|
type = models.CharField('格式', default='文档', max_length=50)
|
||||||
down_count = models.IntegerField('阅读量', default=0)
|
down_count = models.IntegerField('阅读量', default=0)
|
||||||
|
sort = models.IntegerField('排序码', default=1)
|
||||||
|
|
||||||
|
|
|
@ -68,7 +68,7 @@ class MaterialViewSet(ModelViewSet):
|
||||||
filter_backends = [DjangoFilterBackend,SearchFilter, OrderingFilter]
|
filter_backends = [DjangoFilterBackend,SearchFilter, OrderingFilter]
|
||||||
search_fields = ['name','description']
|
search_fields = ['name','description']
|
||||||
ordering_fields = ['update_time', 'down_count']
|
ordering_fields = ['update_time', 'down_count']
|
||||||
ordering = ['-down_count']
|
ordering = ['sort', '-down_count']
|
||||||
filterset_fields = ['type', 'name']
|
filterset_fields = ['type', 'name']
|
||||||
|
|
||||||
@action(methods=['get'], detail=True, url_name='down_material', perms_map=[{'*':'down_material'}])
|
@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