Merge branch 'master' of https://e.coding.net/ctcdevteam/examtest
This commit is contained in:
commit
aa9a6852bb
|
@ -35,6 +35,17 @@
|
||||||
:value="item.value"
|
:value="item.value"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
|
<el-date-picker
|
||||||
|
v-model="datevalue"
|
||||||
|
type="daterange"
|
||||||
|
align="right"
|
||||||
|
unlink-panels
|
||||||
|
range-separator="至"
|
||||||
|
start-placeholder="开始日期"
|
||||||
|
end-placeholder="结束日期"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
:picker-options="pickerOptions">
|
||||||
|
</el-date-picker>
|
||||||
<!-- <el-select
|
<!-- <el-select
|
||||||
v-model="listQuery.is_paid"
|
v-model="listQuery.is_paid"
|
||||||
placeholder="是否缴费"
|
placeholder="是否缴费"
|
||||||
|
@ -335,10 +346,49 @@ export default {
|
||||||
subjectData: [],
|
subjectData: [],
|
||||||
workscopeData: [],
|
workscopeData: [],
|
||||||
roleData:[],
|
roleData:[],
|
||||||
selects: []
|
selects: [],
|
||||||
|
pickerOptions: {
|
||||||
|
shortcuts: [{
|
||||||
|
text: '最近一天',
|
||||||
|
onClick(picker) {
|
||||||
|
const end = new Date();
|
||||||
|
const start = new Date();
|
||||||
|
start.setTime(start.getTime() - 3600 * 1000 * 24);
|
||||||
|
picker.$emit('pick', [start, end]);
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
text: '最近一周',
|
||||||
|
onClick(picker) {
|
||||||
|
const end = new Date();
|
||||||
|
const start = new Date();
|
||||||
|
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
|
||||||
|
picker.$emit('pick', [start, end]);
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
text: '最近一个月',
|
||||||
|
onClick(picker) {
|
||||||
|
const end = new Date();
|
||||||
|
const start = new Date();
|
||||||
|
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
|
||||||
|
picker.$emit('pick', [start, end]);
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
text: '最近三个月',
|
||||||
|
onClick(picker) {
|
||||||
|
const end = new Date();
|
||||||
|
const start = new Date();
|
||||||
|
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
|
||||||
|
picker.$emit('pick', [start, end]);
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
datevalue: '',
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {},
|
computed: {},
|
||||||
|
watch:{
|
||||||
|
datevalue:'setTimeRange',
|
||||||
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getList()
|
this.getList()
|
||||||
this.getCompanyList()
|
this.getCompanyList()
|
||||||
|
@ -571,7 +621,12 @@ export default {
|
||||||
selects.push(val[i].id);
|
selects.push(val[i].id);
|
||||||
}
|
}
|
||||||
this.selects = selects;
|
this.selects = selects;
|
||||||
}
|
},
|
||||||
|
setTimeRange(){
|
||||||
|
this.listQuery.min_create = this.datevalue[0],
|
||||||
|
this.listQuery.max_create = this.datevalue[1],
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -57,9 +57,9 @@ App({
|
||||||
globalData: {
|
globalData: {
|
||||||
userInfo: {},
|
userInfo: {},
|
||||||
userinfo: {}, // 服务器传回的消费者信息
|
userinfo: {}, // 服务器传回的消费者信息
|
||||||
host: 'https://apitest.ahctc.cn',
|
//host: 'https://apitest.ahctc.cn',
|
||||||
mediahost: 'https://apitest.ahctc.cn',
|
mediahost: 'https://apitest.ahctc.cn',
|
||||||
//host: 'http://127.0.0.1:8000',
|
host: 'http://127.0.0.1:8011',
|
||||||
//mediahost: 'http://127.0.0.1:8000',
|
//mediahost: 'http://127.0.0.1:8000',
|
||||||
token : '',
|
token : '',
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
<view class="weui-article">
|
<view class="weui-article">
|
||||||
<view class="weui-article__h2">{{tm_index+1}}.
|
<view class="weui-article__h2">{{tm_index+1}}.
|
||||||
<span class="txlabel">{{tm_current.question.type}}</span>
|
<span class="txlabel">{{tm_current.question.type}}</span>
|
||||||
|
<span style="color:gray">({{tm_current.question.questioncat_name}})</span>
|
||||||
</view>
|
</view>
|
||||||
<view class="weui-article__title">{{tm_current.question.name}}</view>
|
<view class="weui-article__title">{{tm_current.question.name}}</view>
|
||||||
<view wx:if="{{tm_current.img}}" style="text-align:center"><image src="{{tm_current.img}}" mode="aspectFit"></image></view>
|
<view wx:if="{{tm_current.img}}" style="text-align:center"><image src="{{tm_current.img}}" mode="aspectFit"></image></view>
|
||||||
|
|
|
@ -23,9 +23,9 @@
|
||||||
"disablePlugins": [],
|
"disablePlugins": [],
|
||||||
"outputPath": ""
|
"outputPath": ""
|
||||||
},
|
},
|
||||||
"useIsolateContext": true,
|
"useCompilerModule": true,
|
||||||
"useCompilerModule": false,
|
"userConfirmedUseCompilerModuleSwitch": false,
|
||||||
"userConfirmedUseCompilerModuleSwitch": false
|
"useIsolateContext": true
|
||||||
},
|
},
|
||||||
"compileType": "miniprogram",
|
"compileType": "miniprogram",
|
||||||
"libVersion": "2.10.3",
|
"libVersion": "2.10.3",
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
from django_filters import rest_framework as filters
|
||||||
|
from .models import Consumer
|
||||||
|
|
||||||
|
|
||||||
|
class ConsumerFilter(filters.FilterSet):
|
||||||
|
min_create = filters.DateFilter(field_name="create_time", lookup_expr='gte')
|
||||||
|
max_create = filters.DateFilter(field_name="create_time", lookup_expr='lte')
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
model = Consumer
|
||||||
|
fields = ['company', 'role', 'min_create', 'max_create']
|
|
@ -26,7 +26,7 @@ from question.models import Questioncat
|
||||||
from question.serializers import QuestionSerializer
|
from question.serializers import QuestionSerializer
|
||||||
from server import settings
|
from server import settings
|
||||||
from utils.custom import CommonPagination
|
from utils.custom import CommonPagination
|
||||||
|
from .filters import ConsumerFilter
|
||||||
from .exports import export_consumer
|
from .exports import export_consumer
|
||||||
from .models import Company, Consumer, PaySubject, SendCode, ConsumerPerm, ConsumerRole
|
from .models import Company, Consumer, PaySubject, SendCode, ConsumerPerm, ConsumerRole
|
||||||
from .serializers import CompanySerializer, ConsumerSerializer, ConsumerPermSerializer, ConsumerRoleSerializer, ConsumerDetailSerializer
|
from .serializers import CompanySerializer, ConsumerSerializer, ConsumerPermSerializer, ConsumerRoleSerializer, ConsumerDetailSerializer
|
||||||
|
@ -116,7 +116,7 @@ class ConsumerViewSet(ModelViewSet):
|
||||||
ordering_fields = ('id','company','create_time', 'username', 'workscope')
|
ordering_fields = ('id','company','create_time', 'username', 'workscope')
|
||||||
ordering = ['-create_time']
|
ordering = ['-create_time']
|
||||||
filter_backends = [DjangoFilterBackend, SearchFilter, OrderingFilter]
|
filter_backends = [DjangoFilterBackend, SearchFilter, OrderingFilter]
|
||||||
filterset_fields = ['company','role']
|
filterset_class = ConsumerFilter
|
||||||
search_fields = ['name','username','company__name']
|
search_fields = ['name','username','company__name']
|
||||||
|
|
||||||
def get_queryset(self):
|
def get_queryset(self):
|
||||||
|
@ -243,7 +243,7 @@ class ConsumerViewSet(ModelViewSet):
|
||||||
name = name.replace(' ', '')
|
name = name.replace(' ', '')
|
||||||
username = sheet['B'+str(m)].value
|
username = sheet['B'+str(m)].value
|
||||||
if username:
|
if username:
|
||||||
username = str(username).replace(' ', '')
|
username = str(username).replace(' ', '').replace("\n", "")
|
||||||
companyname = sheet['C'+str(m)].value
|
companyname = sheet['C'+str(m)].value
|
||||||
if companyname:
|
if companyname:
|
||||||
companyname = companyname.replace(' ', '')
|
companyname = companyname.replace(' ', '')
|
||||||
|
|
|
@ -85,13 +85,13 @@ class ExamTestListSerializer(serializers.ModelSerializer):
|
||||||
""" Perform necessary eager loading of data. """
|
""" Perform necessary eager loading of data. """
|
||||||
queryset = queryset.select_related('consumer','paper', 'workscope')
|
queryset = queryset.select_related('consumer','paper', 'workscope')
|
||||||
return queryset
|
return queryset
|
||||||
|
from question.serializers import QuestionSerializer
|
||||||
class AnswerDetailSerializer(serializers.ModelSerializer):
|
class AnswerDetailSerializer(serializers.ModelSerializer):
|
||||||
|
question = QuestionSerializer()
|
||||||
class Meta:
|
class Meta:
|
||||||
model = AnswerDetail
|
model = AnswerDetail
|
||||||
exclude = ('examtest',)
|
exclude = ('examtest',)
|
||||||
# fields = '__all__'
|
# fields = '__all__'
|
||||||
depth = 1
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def setup_eager_loading(queryset):
|
def setup_eager_loading(queryset):
|
||||||
|
@ -130,11 +130,12 @@ class PaperQuestionsDetailSerializer(serializers.ModelSerializer):
|
||||||
options = serializers.ReadOnlyField(source='question.options')
|
options = serializers.ReadOnlyField(source='question.options')
|
||||||
right = serializers.ReadOnlyField(source='question.right')
|
right = serializers.ReadOnlyField(source='question.right')
|
||||||
type = serializers.ReadOnlyField(source='question.type')
|
type = serializers.ReadOnlyField(source='question.type')
|
||||||
|
img = serializers.ReadOnlyField(source='question.img')
|
||||||
questioncat_name = serializers.ReadOnlyField(source='question.questioncat.name')
|
questioncat_name = serializers.ReadOnlyField(source='question.questioncat.name')
|
||||||
level = serializers.ReadOnlyField(source='question.level')
|
level = serializers.ReadOnlyField(source='question.level')
|
||||||
class Meta:
|
class Meta:
|
||||||
model = PaperQuestions
|
model = PaperQuestions
|
||||||
fields = ('id','name','options','right','type','level','total_score','questioncat_name')
|
fields = ('id','name','options','right','type','level','total_score','questioncat_name', 'img')
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def setup_eager_loading(queryset):
|
def setup_eager_loading(queryset):
|
||||||
|
|
Loading…
Reference in New Issue