1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- <template>
- <div id="index">
- <list-frame title="题库列表页" @query="search" :filter="filFields" @add="$router.push({ path: '/itembank/detail' })">
- <data-table :fields="fields" :data="index" :opera="opera" @edit="toEdit"></data-table>
- </list-frame>
- </div>
- </template>
- <script>
- import listFrame from '@frame/layout/admin/list-frame';
- import dataTable from '@frame/layout/admin/data-table';
- export default {
- metaInfo: { title: '题库列表页' },
- name: 'index',
- props: {},
- components: {
- listFrame,
- dataTable,
- },
- data: () => ({
- opera: [
- {
- label: '编辑',
- icon: 'el-icon-edit',
- method: 'edit',
- },
- ],
- fields: [
- { label: '题编号', prop: 'id' },
- { label: '题名', prop: 'name' },
- {
- label: '类型',
- prop: 'type',
- format: item => {
- return item === '0' ? '单选' : item === '1' ? '多选' : '问答';
- },
- },
- {
- label: '状态',
- prop: 'state',
- format: item => {
- return item === '0' ? '弃用' : '使用';
- },
- },
- ],
- index: [
- { id: '题编号', name: '礼仪题01', type: '1', state: '1' },
- { id: '题编号', name: 'sss', type: '0', state: '1' },
- { id: '题编号', name: 'test5', type: '2', state: '0' },
- ],
- filFields: [
- { label: '题名', model: 'name' },
- {
- label: '题类型',
- model: 'type',
- type: 'select',
- list: [
- { label: '单选', value: 0 },
- { label: '多选', value: 1 },
- { label: '问答', value: 2 },
- ],
- },
- {
- label: '题状态',
- model: 'state',
- type: 'select',
- list: [
- { label: '弃用', value: 0 },
- { label: '使用', value: 1 },
- ],
- },
- ],
- }),
- created() {},
- computed: {},
- methods: {
- search({ skip = 0, limit = 15, ...info } = {}) {
- console.log(`in search`);
- },
- toEdit(data) {
- console.log(`in toEdit`);
- console.log(data);
- },
- },
- };
- </script>
- <style lang="less" scoped></style>
|