From b952119afcc47b2e8f5f8375f0fdcc22d2a7a197 Mon Sep 17 00:00:00 2001 From: zhangherong <571457620@qq.com> Date: 星期一, 30 六月 2025 11:22:39 +0800 Subject: [PATCH] art:删除示例代码 --- /dev/null | 255 --------------------------------------------------- 1 files changed, 0 insertions(+), 255 deletions(-) diff --git a/src/views/examples/form/BasicForm.vue b/src/views/examples/form/BasicForm.vue deleted file mode 100644 index 0e4bedc..0000000 --- a/src/views/examples/form/BasicForm.vue +++ /dev/null @@ -1,138 +0,0 @@ -<template> - <a-card :body-style="{padding: '24px 32px'}" :bordered="false"> - <a-form @submit="handleSubmit" :form="form"> - <a-form-item - label="鏍囬" - :labelCol="{lg: {span: 7}, sm: {span: 7}}" - :wrapperCol="{lg: {span: 10}, sm: {span: 17} }"> - <a-input - v-decorator="[ - 'name', - {rules: [{ required: true, message: '璇疯緭鍏ユ爣棰�' }]} - ]" - name="name" - placeholder="缁欑洰鏍囪捣涓悕瀛�" /> - </a-form-item> - <a-form-item - label="璧锋鏃ユ湡" - :labelCol="{lg: {span: 7}, sm: {span: 7}}" - :wrapperCol="{lg: {span: 10}, sm: {span: 17} }"> - <a-range-picker - name="buildTime" - style="width: 100%" - v-decorator="[ - 'buildTime', - {rules: [{ required: true, message: '璇烽�夋嫨璧锋鏃ユ湡' }]} - ]" /> - </a-form-item> - <a-form-item - label="鐩爣鎻忚堪" - :labelCol="{lg: {span: 7}, sm: {span: 7}}" - :wrapperCol="{lg: {span: 10}, sm: {span: 17} }"> - <a-textarea - rows="4" - placeholder="璇疯緭鍏ヤ綘闃舵鎬у伐浣滅洰鏍�" - v-decorator="[ - 'description', - {rules: [{ required: true, message: '璇疯緭鍏ョ洰鏍囨弿杩�' }]} - ]" /> - </a-form-item> - <a-form-item - label="琛¢噺鏍囧噯" - :labelCol="{lg: {span: 7}, sm: {span: 7}}" - :wrapperCol="{lg: {span: 10}, sm: {span: 17} }"> - <a-textarea - rows="4" - placeholder="璇疯緭鍏ヨ 閲忔爣鍑�" - v-decorator="[ - 'type', - {rules: [{ required: true, message: '璇疯緭鍏ヨ 閲忔爣鍑�' }]} - ]" /> - </a-form-item> - <a-form-item - label="瀹㈡埛" - :labelCol="{lg: {span: 7}, sm: {span: 7}}" - :wrapperCol="{lg: {span: 10}, sm: {span: 17} }"> - <a-input - placeholder="璇锋弿杩颁綘鏈嶅姟鐨勫鎴凤紝鍐呴儴瀹㈡埛鐩存帴 @濮撳悕锛忓伐鍙�" - v-decorator="[ - 'customer', - {rules: [{ required: true, message: '璇锋弿杩颁綘鏈嶅姟鐨勫鎴�' }]} - ]" /> - </a-form-item> - <a-form-item - label="閭�璇勪汉" - :labelCol="{lg: {span: 7}, sm: {span: 7}}" - :wrapperCol="{lg: {span: 10}, sm: {span: 17} }" - :required="false" - > - <a-input placeholder="璇风洿鎺� @濮撳悕锛忓伐鍙凤紝鏈�澶氬彲閭�璇� 5 浜�" /> - </a-form-item> - <a-form-item - label="鏉冮噸" - :labelCol="{lg: {span: 7}, sm: {span: 7}}" - :wrapperCol="{lg: {span: 10}, sm: {span: 17} }" - :required="false" - > - <a-input-number :min="0" :max="100" /> - <span> %</span> - </a-form-item> - <a-form-item - label="鐩爣鍏紑" - :labelCol="{lg: {span: 7}, sm: {span: 7}}" - :wrapperCol="{lg: {span: 10}, sm: {span: 17} }" - :required="false" - help="瀹㈡埛銆侀個璇勪汉榛樿琚垎浜�" - > - <a-radio-group v-model="value"> - <a-radio :value="1">鍏紑</a-radio> - <a-radio :value="2">閮ㄥ垎鍏紑</a-radio> - <a-radio :value="3">涓嶅叕寮�</a-radio> - </a-radio-group> - <a-form-item> - <a-select mode="multiple" v-if="value === 2"> - <a-select-option value="4">鍚屼簨涓�</a-select-option> - <a-select-option value="5">鍚屼簨浜�</a-select-option> - <a-select-option value="6">鍚屼簨涓�</a-select-option> - </a-select> - </a-form-item> - </a-form-item> - <a-form-item - :wrapperCol="{ span: 24 }" - style="text-align: center" - > - <a-button htmlType="submit" type="primary">鎻愪氦</a-button> - <a-button style="margin-left: 8px">淇濆瓨</a-button> - </a-form-item> - </a-form> - </a-card> -</template> - -<script> - export default { - name: 'BaseForm', - data () { - return { - description: '琛ㄥ崟椤电敤浜庡悜鐢ㄦ埛鏀堕泦鎴栭獙璇佷俊鎭紝鍩虹琛ㄥ崟甯歌浜庢暟鎹」杈冨皯鐨勮〃鍗曞満鏅��', - value: 1, - - // form - form: this.$form.createForm(this), - - } - }, - methods: { - - // handler - handleSubmit (e) { - e.preventDefault() - this.form.validateFields((err, values) => { - if (!err) { - // eslint-disable-next-line no-console - console.log('Received values of form: ', values) - } - }) - } - } - } -</script> \ No newline at end of file diff --git a/src/views/examples/form/advancedForm/AdvancedForm.vue b/src/views/examples/form/advancedForm/AdvancedForm.vue deleted file mode 100644 index ad75b97..0000000 --- a/src/views/examples/form/advancedForm/AdvancedForm.vue +++ /dev/null @@ -1,206 +0,0 @@ -<template> - <div> - <a-card class="card" title="浠撳簱绠$悊" :bordered="false"> - <repository-form ref="repository" :showSubmit="false" /> - </a-card> - <a-card class="card" title="浠诲姟绠$悊" :bordered="false"> - <task-form ref="task" :showSubmit="false" /> - </a-card> - - <!-- table --> - <a-card> - <form :autoFormCreate="(form) => this.form = form"> - <a-table - :columns="columns" - :dataSource="data" - :pagination="false" - > - <template v-for="(col, i) in ['name', 'workId', 'department']" :slot="col" slot-scope="text, record, index"> - <a-input - :key="col" - v-if="record.editable" - style="margin: -5px 0" - :value="text" - :placeholder="columns[i].title" - @change="e => handleChange(e.target.value, record.key, col)" - /> - <template v-else>{{ text }}</template> - </template> - <template slot="operation" slot-scope="text, record, index"> - <template v-if="record.editable"> - <span v-if="record.isNew"> - <a @click="saveRow(record.key)">娣诲姞</a> - <a-divider type="vertical" /> - <a-popconfirm title="鏄惁瑕佸垹闄ゆ琛岋紵" @confirm="remove(record.key)"> - <a>鍒犻櫎</a> - </a-popconfirm> - </span> - <span v-else> - <a @click="saveRow(record.key)">淇濆瓨</a> - <a-divider type="vertical" /> - <a @click="cancel(record.key)">鍙栨秷</a> - </span> - </template> - <span v-else> - <a @click="toggle(record.key)">缂栬緫</a> - <a-divider type="vertical" /> - <a-popconfirm title="鏄惁瑕佸垹闄ゆ琛岋紵" @confirm="remove(record.key)"> - <a>鍒犻櫎</a> - </a-popconfirm> - </span> - </template> - </a-table> - <a-button style="width: 100%; margin-top: 16px; margin-bottom: 8px" type="dashed" icon="plus" @click="newMember">鏂板鎴愬憳</a-button> - </form> - </a-card> - - <!-- fixed footer toolbar --> - <footer-tool-bar> - <a-button type="primary" @click="validate" :loading="loading">鎻愪氦</a-button> - </footer-tool-bar> - </div> -</template> - -<script> - import RepositoryForm from './RepositoryForm' - import TaskForm from './TaskForm' - import FooterToolBar from '@/components/tools/FooterToolBar' - - export default { - name: "AdvancedForm", - components: { - FooterToolBar, - RepositoryForm, - TaskForm - }, - data () { - return { - description: '楂樼骇琛ㄥ崟甯歌浜庝竴娆℃�ц緭鍏ュ拰鎻愪氦澶ф壒閲忔暟鎹殑鍦烘櫙銆�', - loading: false, - - // table - columns: [ - { - title: '鎴愬憳濮撳悕', - dataIndex: 'name', - key: 'name', - width: '20%', - scopedSlots: { customRender: 'name' } - }, - { - title: '宸ュ彿', - dataIndex: 'workId', - key: 'workId', - width: '20%', - scopedSlots: { customRender: 'workId' } - }, - { - title: '鎵�灞為儴闂�', - dataIndex: 'department', - key: 'department', - width: '40%', - scopedSlots: { customRender: 'department' } - }, - { - title: '鎿嶄綔', - key: 'action', - scopedSlots: { customRender: 'operation' } - } - ], - data: [ - { - key: '1', - name: '灏忔槑', - workId: '001', - editable: false, - department: '琛屾斂閮�' - }, - { - key: '2', - name: '鏉庤帀', - workId: '002', - editable: false, - department: 'IT閮�' - }, - { - key: '3', - name: '鐜嬪皬甯�', - workId: '003', - editable: false, - department: '璐㈠姟閮�' - } - ] - } - }, - methods: { - handleSubmit (e) { - e.preventDefault() - }, - newMember () { - this.data.push({ - key: '-1', - name: '', - workId: '', - department: '', - editable: true, - isNew: true - }) - }, - remove (key) { - const newData = this.data.filter(item => item.key !== key) - this.data = newData - }, - saveRow (key) { - let target = this.data.filter(item => item.key === key)[0] - target.editable = false - target.isNew = false - }, - toggle (key) { - let target = this.data.filter(item => item.key === key)[0] - target.editable = !target.editable - }, - getRowByKey (key, newData) { - const data = this.data - return (newData || data).filter(item => item.key === key)[0] - }, - cancel (key) { - let target = this.data.filter(item => item.key === key)[0] - target.editable = false - }, - handleChange (value, key, column) { - const newData = [...this.data] - const target = newData.filter(item => key === item.key)[0] - if (target) { - target[column] = value - this.data = newData - } - }, - - // 鏈�缁堝叏椤甸潰鎻愪氦 - validate () { - this.$refs.repository.form.validateFields((err, values) => { - if (!err) { - this.$notification['error']({ - message: 'Received values of form:', - description: values - }) - } - }) - this.$refs.task.form.validateFields((err, values) => { - if (!err) { - this.$notification['error']({ - message: 'Received values of form:', - description: values - }) - } - }) - } - } - } -</script> - -<style lang="less" scoped> - .card{ - margin-bottom: 24px; - } -</style> \ No newline at end of file diff --git a/src/views/examples/form/advancedForm/RepositoryForm.vue b/src/views/examples/form/advancedForm/RepositoryForm.vue deleted file mode 100644 index 0ad1fad..0000000 --- a/src/views/examples/form/advancedForm/RepositoryForm.vue +++ /dev/null @@ -1,119 +0,0 @@ -<template> - <a-form @submit="handleSubmit" :form="form" class="form"> - <a-row class="form-row" :gutter="16"> - <a-col :lg="6" :md="12" :sm="24"> - <a-form-item label="浠撳簱鍚�"> - <a-input - placeholder="璇疯緭鍏ヤ粨搴撳悕绉�" - v-decorator="[ - 'repository.name', - {rules: [{ required: true, message: '璇疯緭鍏ヤ粨搴撳悕绉�', whitespace: true}]} - ]" /> - </a-form-item> - </a-col> - <a-col :xl="{span: 7, offset: 1}" :lg="{span: 8}" :md="{span: 12}" :sm="24"> - <a-form-item - label="浠撳簱鍩熷悕"> - <a-input - addonBefore="http://" - addonAfter=".com" - placeholder="璇疯緭鍏�" - v-decorator="[ - 'repository.domain', - {rules: [{ required: true, message: '璇疯緭鍏ヤ粨搴撳煙鍚�', whitespace: true}, {validator: validate}]} - ]" /> - </a-form-item> - </a-col> - <a-col :xl="{span: 9, offset: 1}" :lg="{span: 10}" :md="{span: 24}" :sm="24"> - <a-form-item - label="浠撳簱绠$悊鍛�"> - <a-select placeholder="璇烽�夋嫨绠$悊鍛�" v-decorator="[ 'repository.manager', {rules: [{ required: true, message: '璇烽�夋嫨绠$悊鍛�'}]} ]"> - <a-select-option value="鐜嬪悓瀛�">鐜嬪悓瀛�</a-select-option> - <a-select-option value="鏉庡悓瀛�">鏉庡悓瀛�</a-select-option> - <a-select-option value="榛勫悓瀛�">榛勫悓瀛�</a-select-option> - </a-select> - </a-form-item> - </a-col> - </a-row> - <a-row class="form-row" :gutter="16"> - <a-col :lg="6" :md="12" :sm="24"> - <a-form-item - label="瀹℃壒浜�"> - <a-select placeholder="璇烽�夋嫨瀹℃壒鍛�" v-decorator="[ 'repository.auditor', {rules: [{ required: true, message: '璇烽�夋嫨瀹℃壒鍛�'}]} ]"> - <a-select-option value="鐜嬫檽涓�">鐜嬫檽涓�</a-select-option> - <a-select-option value="鏉庡啗">鏉庡啗</a-select-option> - </a-select> - </a-form-item> - </a-col> - <a-col :xl="{span: 7, offset: 1}" :lg="{span: 8}" :md="{span: 12}" :sm="24"> - <a-form-item - label="鐢熸晥鏃ユ湡"> - <a-range-picker - style="width: 100%" - v-decorator="[ - 'repository.effectiveDate', - {rules: [{ required: true, message: '璇烽�夋嫨鐢熸晥鏃ユ湡'}]} - ]" /> - </a-form-item> - </a-col> - <a-col :xl="{span: 9, offset: 1}" :lg="{span: 10}" :md="{span: 24}" :sm="24"> - <a-form-item - label="浠撳簱绫诲瀷"> - <a-select - placeholder="璇烽�夋嫨浠撳簱绫诲瀷" - v-decorator="[ - 'repository.type', - {rules: [{ required: true, message: '璇烽�夋嫨浠撳簱绫诲瀷'}]} - ]" > - <a-select-option value="鍏紑">鍏紑</a-select-option> - <a-select-option value="绉佸瘑">绉佸瘑</a-select-option> - </a-select> - </a-form-item> - </a-col> - </a-row> - <a-form-item v-if="showSubmit"> - <a-button htmlType="submit" >Submit</a-button> - </a-form-item> - </a-form> -</template> - -<script> - export default { - name: "RepositoryForm", - props: { - showSubmit: { - type: Boolean, - default: false - } - }, - data () { - return { - form: this.$form.createForm(this) - } - }, - methods: { - handleSubmit (e) { - e.preventDefault() - this.form.validateFields((err, values) => { - if (!err) { - this.$notification['error']({ - message: 'Received values of form:', - description: values - }) - } - }) - }, - validate (rule, value, callback) { - const regex = /^user-(.*)$/ - if (!regex.test(value)) { - callback('闇�瑕佷互 user- 寮�澶�') - } - callback() - } - } - } -</script> - -<style scoped> - -</style> \ No newline at end of file diff --git a/src/views/examples/form/advancedForm/TaskForm.vue b/src/views/examples/form/advancedForm/TaskForm.vue deleted file mode 100644 index e1af2ae..0000000 --- a/src/views/examples/form/advancedForm/TaskForm.vue +++ /dev/null @@ -1,107 +0,0 @@ -<template> - <a-form @submit="handleSubmit" :form="form" class="form"> - <a-row class="form-row" :gutter="16"> - <a-col :lg="6" :md="12" :sm="24"> - <a-form-item - label="浠诲姟鍚�"> - <a-input placeholder="璇疯緭鍏ヤ换鍔″悕绉�" v-decorator="[ 'task.name', {rules: [{ required: true, message: '璇疯緭鍏ヤ换鍔″悕绉�', whitespace: true}]} ]" /> - </a-form-item> - </a-col> - <a-col :xl="{span: 7, offset: 1}" :lg="{span: 8}" :md="{span: 12}" :sm="24"> - <a-form-item - label="浠诲姟鎻忚堪"> - <a-input placeholder="璇疯緭鍏ヤ换鍔℃弿杩�" v-decorator="[ 'task.description', {rules: [{ required: true, message: '璇疯緭鍏ヤ换鍔℃弿杩�', whitespace: true}]} ]" /> - </a-form-item> - </a-col> - <a-col :xl="{span: 9, offset: 1}" :lg="{span: 10}" :md="{span: 24}" :sm="24"> - <a-form-item - label="鎵ц浜�"> - <a-select - placeholder="璇烽�夋嫨鎵ц浜�" - v-decorator="[ - 'task.executor', - {rules: [{ required: true, message: '璇烽�夋嫨鎵ц浜�'}]} - ]" > - <a-select-option value="榛勪附涓�">榛勪附涓�</a-select-option> - <a-select-option value="鏉庡ぇ鍒�">鏉庡ぇ鍒�</a-select-option> - </a-select> - </a-form-item> - </a-col> - </a-row> - <a-row class="form-row" :gutter="16"> - <a-col :lg="6" :md="12" :sm="24"> - <a-form-item - label="璐d换浜�"> - <a-select - placeholder="璇烽�夋嫨璐d换浜�" - v-decorator="[ - 'task.manager', - {rules: [{ required: true, message: '璇烽�夋嫨璐d换浜�'}]} - ]" > - <a-select-option value="鐜嬩紵">鐜嬩紵</a-select-option> - <a-select-option value="鏉庣孩鍐�">鏉庣孩鍐�</a-select-option> - </a-select> - </a-form-item> - </a-col> - <a-col :xl="{span: 7, offset: 1}" :lg="{span: 8}" :md="{span: 12}" :sm="24"> - <a-form-item - label="鎻愰啋鏃堕棿"> - <a-time-picker - style="width: 100%" - v-decorator="[ - 'task.time', - {rules: [{ required: true, message: '璇烽�夋嫨鎻愰啋鏃堕棿'}]} - ]" /> - </a-form-item> - </a-col> - <a-col :xl="{span: 9, offset: 1}" :lg="{span: 10}" :md="{span: 24}" :sm="24"> - <a-form-item - label="浠诲姟绫诲瀷"> - <a-select - placeholder="璇烽�夋嫨浠诲姟绫诲瀷" - v-decorator="[ 'task.type', {rules: [{ required: true, message: '璇烽�夋嫨浠诲姟绫诲瀷'}]} ]" > - <a-select-option value="瀹氭椂鎵ц">瀹氭椂鎵ц</a-select-option> - <a-select-option value="鍛ㄦ湡鎵ц">鍛ㄦ湡鎵ц</a-select-option> - </a-select> - </a-form-item> - </a-col> - </a-row> - <a-form-item v-if="showSubmit"> - <a-button htmlType="submit" >Submit</a-button> - </a-form-item> - </a-form> -</template> - -<script> - export default { - name: "TaskForm", - props: { - showSubmit: { - type: Boolean, - default: false - } - }, - data () { - return { - form: this.$form.createForm(this) - } - }, - methods: { - handleSubmit (e) { - e.preventDefault() - this.form.validateFields((err, values) => { - if (!err) { - this.$notification['error']({ - message: 'Received values of form:', - description: values - }) - } - }) - } - } - } -</script> - -<style scoped> - -</style> \ No newline at end of file diff --git a/src/views/examples/form/stepForm/Step1.vue b/src/views/examples/form/stepForm/Step1.vue deleted file mode 100644 index 384602c..0000000 --- a/src/views/examples/form/stepForm/Step1.vue +++ /dev/null @@ -1,60 +0,0 @@ -<template> - <div> - <a-form style="max-width: 500px; margin: 40px auto 0;"> - <a-form-item - label="浠樻璐︽埛" - :labelCol="{span: 5}" - :wrapperCol="{span: 19}" - > - <a-select value="1" placeholder="ant-design@alipay.com"> - <a-select-option value="1">ant-design@alipay.com</a-select-option> - </a-select> - </a-form-item> - <a-form-item - label="鏀舵璐︽埛" - :labelCol="{span: 5}" - :wrapperCol="{span: 19}" - > - <a-input-group :compact="true" style="display: inline-block; vertical-align: middle"> - <a-select defaultValue="alipay" style="width: 100px"> - <a-select-option value="alipay">鏀粯瀹�</a-select-option> - <a-select-option value="wexinpay">寰俊</a-select-option> - </a-select> - <a-input :style="{width: 'calc(100% - 100px)'}" value="test@example.com"/> - </a-input-group> - </a-form-item> - <a-form-item - label="鏀舵浜哄鍚�" - :labelCol="{span: 5}" - :wrapperCol="{span: 19}" - > - <a-input value="Alex" /> - </a-form-item> - <a-form-item - label="杞处閲戦" - :labelCol="{span: 5}" - :wrapperCol="{span: 19}" - > - <a-input prefix="锟�" value="5000" /> - </a-form-item> - <a-form-item :wrapperCol="{span: 19, offset: 5}"> - <a-button type="primary" @click="nextStep">涓嬩竴姝�</a-button> - </a-form-item> - </a-form> - </div> -</template> - -<script> - export default { - name: "Step1", - methods: { - nextStep () { - this.$emit('nextStep') - } - } - } -</script> - -<style scoped> - -</style> \ No newline at end of file diff --git a/src/views/examples/form/stepForm/Step2.vue b/src/views/examples/form/stepForm/Step2.vue deleted file mode 100644 index 5e02c41..0000000 --- a/src/views/examples/form/stepForm/Step2.vue +++ /dev/null @@ -1,82 +0,0 @@ -<template> - <div> - <a-form style="max-width: 500px; margin: 40px auto 0;"> - <a-alert - :closable="true" - message="纭杞处鍚庯紝璧勯噾灏嗙洿鎺ユ墦鍏ュ鏂硅处鎴凤紝鏃犳硶閫�鍥炪��" - style="margin-bottom: 24px;" - /> - <a-form-item - label="浠樻璐︽埛" - :labelCol="{span: 5}" - :wrapperCol="{span: 19}" - class="stepFormText" - > - ant-design@alipay.com - </a-form-item> - <a-form-item - label="鏀舵璐︽埛" - :labelCol="{span: 5}" - :wrapperCol="{span: 19}" - class="stepFormText" - > - test@example.com - </a-form-item> - <a-form-item - label="鏀舵浜哄鍚�" - :labelCol="{span: 5}" - :wrapperCol="{span: 19}" - class="stepFormText" - > - Alex - </a-form-item> - <a-form-item - label="杞处閲戦" - :labelCol="{span: 5}" - :wrapperCol="{span: 19}" - class="stepFormText" - > - 锟� 5,000.00 - </a-form-item> - <a-form-item :wrapperCol="{span: 19, offset: 5}"> - <a-button :loading="loading" type="primary" @click="nextStep">鎻愪氦</a-button> - <a-button style="margin-left: 8px" @click="prevStep">涓婁竴姝�</a-button> - </a-form-item> - </a-form> - </div> -</template> - -<script> - export default { - name: "Step2", - data () { - return { - loading: false - } - }, - methods: { - nextStep () { - let that = this - that.loading = true - setTimeout(function () { - that.$emit('nextStep') - }, 1500) - }, - prevStep () { - this.$emit('prevStep') - } - } - } -</script> - -<style lang="less" scoped> - .stepFormText { - margin-bottom: 24px; - - .ant-form-item-label, - .ant-form-item-control { - line-height: 22px; - } - } - -</style> \ No newline at end of file diff --git a/src/views/examples/form/stepForm/Step3.vue b/src/views/examples/form/stepForm/Step3.vue deleted file mode 100644 index b3c87af..0000000 --- a/src/views/examples/form/stepForm/Step3.vue +++ /dev/null @@ -1,69 +0,0 @@ -<template> - <div> - <a-form style="margin: 40px auto 0;"> - <result title="鎿嶄綔鎴愬姛" :is-success="true" description="棰勮涓ゅ皬鏃跺唴鍒拌处"> - <div class="information"> - <a-row> - <a-col :sm="8" :xs="24">浠樻璐︽埛锛�</a-col> - <a-col :sm="16" :xs="24">ant-design@alipay.com</a-col> - </a-row> - <a-row> - <a-col :sm="8" :xs="24">鏀舵璐︽埛锛�</a-col> - <a-col :sm="16" :xs="24">test@example.com</a-col> - </a-row> - <a-row> - <a-col :sm="8" :xs="24">鏀舵浜哄鍚嶏細</a-col> - <a-col :sm="16" :xs="24">杈夊</a-col> - </a-row> - <a-row> - <a-col :sm="8" :xs="24">杞处閲戦锛�</a-col> - <a-col :sm="16" :xs="24"><span class="money">500</span> 鍏�</a-col> - </a-row> - </div> - <div slot="action"> - <a-button type="primary" @click="finish">鍐嶈浆涓�绗�</a-button> - <a-button style="margin-left: 8px" @click="toOrderList">鏌ョ湅璐﹀崟</a-button> - </div> - </result> - </a-form> - </div> -</template> - -<script> - import Result from '../../../result/Result' - - export default { - name: "Step3", - components: { - Result - }, - data () { - return { - loading: false - } - }, - methods: { - finish () { - this.$emit('finish') - }, - toOrderList () { - this.$router.push('/list/query-list') - } - } - } -</script> -<style lang="less" scoped> - .information { - line-height: 22px; - - .ant-row:not(:last-child) { - margin-bottom: 24px; - } - } - .money { - font-family: "Helvetica Neue",sans-serif; - font-weight: 500; - font-size: 20px; - line-height: 14px; - } -</style> \ No newline at end of file diff --git a/src/views/examples/form/stepForm/StepForm.vue b/src/views/examples/form/stepForm/StepForm.vue deleted file mode 100644 index 623d644..0000000 --- a/src/views/examples/form/stepForm/StepForm.vue +++ /dev/null @@ -1,62 +0,0 @@ -<template> - <a-card :bordered="false"> - <a-steps class="steps" :current="currentTab"> - <a-step title="濉啓杞处淇℃伅" /> - <a-step title="纭杞处淇℃伅" /> - <a-step title="瀹屾垚" /> - </a-steps> - <div class="content"> - <step1 v-if="currentTab === 0" @nextStep="nextStep"/> - <step2 v-if="currentTab === 1" @nextStep="nextStep" @prevStep="prevStep"/> - <step3 v-if="currentTab === 2" @prevStep="prevStep" @finish="finish"/> - </div> - </a-card> -</template> - -<script> - import Step1 from './Step1' - import Step2 from './Step2' - import Step3 from './Step3' - - export default { - name: "StepForm", - components: { - Step1, - Step2, - Step3 - }, - data () { - return { - description: '灏嗕竴涓啑闀挎垨鐢ㄦ埛涓嶇啛鎮夌殑琛ㄥ崟浠诲姟鍒嗘垚澶氫釜姝ラ锛屾寚瀵肩敤鎴峰畬鎴愩��', - currentTab: 0, - - // form - form: null, - } - }, - methods: { - - // handler - nextStep () { - if (this.currentTab < 2) { - this.currentTab += 1 - } - }, - prevStep () { - if (this.currentTab > 0) { - this.currentTab -= 1 - } - }, - finish () { - this.currentTab = 0 - } - } - } -</script> - -<style lang="less" scoped> - .steps { - max-width: 750px; - margin: 16px auto; - } -</style> \ No newline at end of file diff --git a/src/views/examples/list/CardList.vue b/src/views/examples/list/CardList.vue deleted file mode 100644 index 4208017..0000000 --- a/src/views/examples/list/CardList.vue +++ /dev/null @@ -1,109 +0,0 @@ -<template> - <div class="card-list" ref="content"> - <a-list - :grid="{gutter: 24, lg: 3, md: 2, sm: 1, xs: 1}" - :dataSource="dataSource" - > - <a-list-item slot="renderItem" slot-scope="item, index"> - <template v-if="index === 0"> - <a-button class="new-btn" type="dashed"> - <a-icon type="plus"/> - 鏂板浜у搧 - </a-button> - </template> - <template v-else> - <a-card :hoverable="true"> - <a-card-meta> - <div style="margin-bottom: 3px" slot="title">{{ item.title }}</div> - <a-avatar class="card-avatar" slot="avatar" :src="item.avatar" size="large"/> - <div class="meta-content" slot="description">{{ item.content }}</div> - </a-card-meta> - <template class="ant-card-actions" slot="actions"> - <a>鎿嶄綔涓�</a> - <a>鎿嶄綔浜�</a> - </template> - </a-card> - </template> - </a-list-item> - </a-list> - </div> -</template> - -<script> - - const dataSource = [] - for (let i = 0; i < 12; i++) { - dataSource.push({ - title: 'Alipay', - avatar: 'https://gw.alipayobjects.com/zos/rmsportal/WdGqmHpayyMjiEhcKoVE.png', - content: '鍦ㄤ腑鍙颁骇鍝佺殑鐮斿彂杩囩▼涓紝浼氬嚭鐜颁笉鍚岀殑璁捐瑙勮寖鍜屽疄鐜版柟寮忥紝浣嗗叾涓線寰�瀛樺湪寰堝绫讳技鐨勯〉闈㈠拰缁勪欢锛岃繖浜涚被浼肩殑缁勪欢浼氳鎶界鎴愪竴濂楁爣鍑嗚鑼冦��' - }) - } - - - export default { - name: "CardList", - data () { - return { - description: '娈佃惤绀烘剰锛氳殏铓侀噾鏈嶅姟璁捐骞冲彴 ant.design锛岀敤鏈�灏忕殑宸ヤ綔閲忥紝鏃犵紳鎺ュ叆铓傝殎閲戞湇鐢熸�侊紝 鎻愪緵璺ㄨ秺璁捐涓庡紑鍙戠殑浣撻獙瑙e喅鏂规銆�', - linkList: [ - { icon: 'rocket', href: '#', title: '蹇�熷紑濮�' }, - { icon: 'info-circle-o', href: '#', title: '浜у搧绠�浠�' }, - { icon: 'file-text', href: '#', title: '浜у搧鏂囨。' } - ], - extraImage: 'https://gw.alipayobjects.com/zos/rmsportal/RzwpdLnhmvDJToTdfDPe.png', - dataSource - } - } - } -</script> - -<style lang="less" scoped> - .card-avatar { - width: 48px; - height: 48px; - border-radius: 48px; - } - - .ant-card-actions { - background: #f7f9fa; - li { - float: left; - text-align: center; - margin: 12px 0; - color: rgba(0, 0, 0, 0.45); - width: 50%; - - &:not(:last-child) { - border-right: 1px solid #e8e8e8; - } - - a { - color: rgba(0, 0, 0, .45); - line-height: 22px; - display: inline-block; - width: 100%; - &:hover { - color: #1890ff; - } - } - } - } - - .new-btn { - background-color: #fff; - border-radius: 2px; - width: 100%; - height: 186px; - } - - .meta-content { - position: relative; - overflow: hidden; - text-overflow: ellipsis; - display: -webkit-box; - height: 64px; - -webkit-line-clamp: 3; - -webkit-box-orient: vertical; - } -</style> \ No newline at end of file diff --git a/src/views/examples/list/PermissionList.vue b/src/views/examples/list/PermissionList.vue deleted file mode 100644 index 2efcfce..0000000 --- a/src/views/examples/list/PermissionList.vue +++ /dev/null @@ -1,272 +0,0 @@ -<template> - <a-card :bordered="false"> - <div class="table-page-search-wrapper"> - <a-form layout="inline"> - <a-row :gutter="48"> - <a-col :md="8" :sm="24"> - <a-form-item label="瑙掕壊ID"> - <a-input placeholder="璇疯緭鍏�"/> - </a-form-item> - </a-col> - <a-col :md="8" :sm="24"> - <a-form-item label="鐘舵��"> - <a-select placeholder="璇烽�夋嫨" default-value="0"> - <a-select-option value="0">鍏ㄩ儴</a-select-option> - <a-select-option value="1">鍏抽棴</a-select-option> - <a-select-option value="2">杩愯涓�</a-select-option> - </a-select> - </a-form-item> - </a-col> - <a-col :md="8" :sm="24"> - <span class="table-page-search-submitButtons"> - <a-button type="primary">鏌ヨ</a-button> - <a-button style="margin-left: 8px">閲嶇疆</a-button> - </span> - </a-col> - </a-row> - </a-form> - </div> - - <s-table :columns="columns" :data="loadData"> - - <span slot="actions" slot-scope="text, record"> - <a-tag v-for="(action, index) in record.actionList" :key="index">{{ action.describe }}</a-tag> - </span> - - <span slot="status" slot-scope="text"> - {{ text | statusFilter }} - </span> - - <span slot="action" slot-scope="text, record"> - <a @click="handleEdit(record)">缂栬緫</a> - <a-divider type="vertical" /> - <a-dropdown> - <a class="ant-dropdown-link"> - 鏇村 <a-icon type="down" /> - </a> - <a-menu slot="overlay"> - <a-menu-item> - <a href="javascript:;">璇︽儏</a> - </a-menu-item> - <a-menu-item> - <a href="javascript:;">绂佺敤</a> - </a-menu-item> - <a-menu-item> - <a href="javascript:;">鍒犻櫎</a> - </a-menu-item> - </a-menu> - </a-dropdown> - </span> - </s-table> - - <a-modal - title="鎿嶄綔" - :width="800" - v-model="visible" - @ok="handleOk" - > - <a-form :autoFormCreate="(form)=>{this.form = form}"> - - <a-form-item - :labelCol="labelCol" - :wrapperCol="wrapperCol" - label="鍞竴璇嗗埆鐮�" - hasFeedback - validateStatus="success" - > - <a-input placeholder="鍞竴璇嗗埆鐮�" v-model="mdl.id" id="no" disabled="disabled" /> - </a-form-item> - - <a-form-item - :labelCol="labelCol" - :wrapperCol="wrapperCol" - label="鏉冮檺鍚嶇О" - hasFeedback - validateStatus="success" - > - <a-input placeholder="璧蜂竴涓悕瀛�" v-model="mdl.name" id="permission_name" /> - </a-form-item> - - <a-form-item - :labelCol="labelCol" - :wrapperCol="wrapperCol" - label="鐘舵��" - hasFeedback - validateStatus="warning" - > - <a-select v-model="mdl.status"> - <a-select-option value="1">姝e父</a-select-option> - <a-select-option value="2">绂佺敤</a-select-option> - </a-select> - </a-form-item> - - <a-form-item - :labelCol="labelCol" - :wrapperCol="wrapperCol" - label="鎻忚堪" - hasFeedback - > - <a-textarea :rows="5" v-model="mdl.describe" placeholder="..." id="describe"/> - </a-form-item> - - <a-divider /> - - <a-form-item - :labelCol="labelCol" - :wrapperCol="wrapperCol" - label="璧嬩簣鏉冮檺" - hasFeedback - > - <a-select - style="width: 100%" - mode="multiple" - v-model="mdl.actions" - :allowClear="true" - > - <a-select-option v-for="(action, index) in permissionList" :key="index" :value="action.value">{{ action.label }}</a-select-option> - </a-select> - </a-form-item> - - </a-form> - </a-modal> - - </a-card> -</template> - -<script> - import STable from '@/components/table/' - - export default { - name: "TableList", - components: { - STable - }, - data () { - return { - description: '鍒楄〃浣跨敤鍦烘櫙锛氬悗鍙扮鐞嗕腑鐨勬潈闄愮鐞嗕互鍙婅鑹茬鐞嗭紝鍙敤浜庡熀浜� RBAC 璁捐鐨勮鑹叉潈闄愭帶鍒讹紝棰楃矑搴︾粏鍒版瘡涓�涓搷浣滅被鍨嬨��', - - visible: false, - labelCol: { - xs: { span: 24 }, - sm: { span: 5 }, - }, - wrapperCol: { - xs: { span: 24 }, - sm: { span: 16 }, - }, - form: null, - mdl: {}, - - // 楂樼骇鎼滅储 灞曞紑/鍏抽棴 - advanced: false, - // 鏌ヨ鍙傛暟 - queryParam: {}, - // 琛ㄥご - columns: [ - { - title: '鍞竴璇嗗埆鐮�', - dataIndex: 'id' - }, - { - title: '鏉冮檺鍚嶇О', - dataIndex: 'name', - }, - { - title: '鍙搷浣滄潈闄�', - dataIndex: 'actions', - scopedSlots: { customRender: 'actions' }, - }, - { - title: '鐘舵��', - dataIndex: 'status', - scopedSlots: { customRender: 'status' }, - }, - { - title: '鎿嶄綔', - width: '150px', - dataIndex: 'action', - scopedSlots: { customRender: 'action' }, - } - ], - // 鍚戝悗绔媺鍙栧彲浠ョ敤鐨勬搷浣滃垪琛� - permissionList: null, - // 鍔犺浇鏁版嵁鏂规硶 蹇呴』涓� Promise 瀵硅薄 - loadData: parameter => { - return this.$http.get('/mock/api/permission', { - params: Object.assign(parameter, this.queryParam) - }).then(res => { - let result = res.result - result.data.map(permission => { - permission.actionList = JSON.parse(permission.actionData) - return permission - }) - return result - }) - }, - - selectedRowKeys: [], - selectedRows: [] - } - }, - filters: { - statusFilter(status) { - const statusMap = { - 1: '姝e父', - 2: '绂佺敤' - } - return statusMap[status] - } - }, - created () { - this.loadPermissionList() - }, - methods: { - loadPermissionList () { - // permissionList - new Promise((resolve => { - const data = [ - { label: '鏂板', value: 'add', defaultChecked: false }, - { label: '鏌ヨ', value: 'get', defaultChecked: false }, - { label: '淇敼', value: 'update', defaultChecked: false }, - { label: '鍒楄〃', value: 'query', defaultChecked: false }, - { label: '鍒犻櫎', value: 'delete', defaultChecked: false }, - { label: '瀵煎叆', value: 'import', defaultChecked: false }, - { label: '瀵煎嚭', value: 'export', defaultChecked: false } - ] - setTimeout(resolve(data), 1500) - })).then(res => { - this.permissionList = res - }) - }, - handleEdit (record) { - this.mdl = Object.assign({}, record) - console.log(this.mdl) - this.visible = true - }, - handleOk () { - - }, - onChange (selectedRowKeys, selectedRows) { - this.selectedRowKeys = selectedRowKeys - this.selectedRows = selectedRows - }, - toggleAdvanced () { - this.advanced = !this.advanced - }, - }, - watch: { - /* - 'selectedRows': function (selectedRows) { - this.needTotalList = this.needTotalList.map(item => { - return { - ...item, - total: selectedRows.reduce( (sum, val) => { - return sum + val[item.dataIndex] - }, 0) - } - }) - } - */ - } - } -</script> \ No newline at end of file diff --git a/src/views/examples/list/RoleList.vue b/src/views/examples/list/RoleList.vue deleted file mode 100644 index 21dd517..0000000 --- a/src/views/examples/list/RoleList.vue +++ /dev/null @@ -1,183 +0,0 @@ -<template> - <a-card :bordered="false"> - <div class="table-page-search-wrapper"> - <a-form layout="inline"> - <a-row :gutter="48"> - <a-col :md="8" :sm="24"> - <a-form-item label="瑙掕壊ID"> - <a-input placeholder="璇疯緭鍏�"/> - </a-form-item> - </a-col> - <a-col :md="8" :sm="24"> - <a-form-item label="鐘舵��"> - <a-select placeholder="璇烽�夋嫨" default-value="0"> - <a-select-option value="0">鍏ㄩ儴</a-select-option> - <a-select-option value="1">姝e父</a-select-option> - <a-select-option value="2">绂佺敤</a-select-option> - </a-select> - </a-form-item> - </a-col> - <a-col :md="8" :sm="24"> - <span class="table-page-search-submitButtons"> - <a-button type="primary">鏌ヨ</a-button> - <a-button style="margin-left: 8px">閲嶇疆</a-button> - </span> - </a-col> - </a-row> - </a-form> - </div> - - <s-table - ref="table" - size="default" - :columns="columns" - :data="loadData" - :scroll="{}" - > - <div - slot="expandedRowRender" - slot-scope="record" - style="margin: 0"> - <a-row - :gutter="24" - :style="{ marginBottom: '12px' }"> - <a-col :span="12" v-for="(role, index) in record.permissions" :key="index" :style="{ marginBottom: '12px' }"> - <a-col :span="4"> - <span>{{ role.permissionName }}锛�</span> - </a-col> - <a-col :span="20" v-if="role.actionEntitySet.length > 0"> - <a-tag color="cyan" v-for="(action, k) in role.actionEntitySet" :key="k">{{ action.describe }}</a-tag> - </a-col> - <a-col :span="20" v-else>-</a-col> - </a-col> - </a-row> - </div> - <span slot="action" slot-scope="text, record"> - <a @click="$refs.modal.edit(record)">缂栬緫</a> - <a-divider type="vertical" /> - <a-dropdown> - <a class="ant-dropdown-link"> - 鏇村 <a-icon type="down" /> - </a> - <a-menu slot="overlay"> - <a-menu-item> - <a href="javascript:;">璇︽儏</a> - </a-menu-item> - <a-menu-item> - <a href="javascript:;">绂佺敤</a> - </a-menu-item> - <a-menu-item> - <a href="javascript:;">鍒犻櫎</a> - </a-menu-item> - </a-menu> - </a-dropdown> - </span> - </s-table> - - <role-modal ref="modal" @ok="handleOk"></role-modal> - - </a-card> -</template> - -<script> - import STable from '@/components/table/' - import RoleModal from './modules/RoleModal' - - export default { - name: "TableList", - components: { - STable, - RoleModal - }, - data () { - return { - description: '鍒楄〃浣跨敤鍦烘櫙锛氬悗鍙扮鐞嗕腑鐨勬潈闄愮鐞嗕互鍙婅鑹茬鐞嗭紝鍙敤浜庡熀浜� RBAC 璁捐鐨勮鑹叉潈闄愭帶鍒讹紝棰楃矑搴︾粏鍒版瘡涓�涓搷浣滅被鍨嬨��', - - visible: false, - - form: null, - mdl: {}, - - // 楂樼骇鎼滅储 灞曞紑/鍏抽棴 - advanced: false, - // 鏌ヨ鍙傛暟 - queryParam: {}, - // 琛ㄥご - columns: [ - { - title: '鍞竴璇嗗埆鐮�', - dataIndex: 'id' - }, - { - title: '瑙掕壊鍚嶇О', - dataIndex: 'name', - }, - { - title: '鐘舵��', - dataIndex: 'status' - }, - { - title: '鍒涘缓鏃堕棿', - dataIndex: 'createTime', - sorter: true - }, { - title: '鎿嶄綔', - width: '150px', - dataIndex: 'action', - scopedSlots: { customRender: 'action' }, - } - ], - // 鍔犺浇鏁版嵁鏂规硶 蹇呴』涓� Promise 瀵硅薄 - loadData: parameter => { - return this.$http.get('/mock/api/role', { - params: Object.assign(parameter, this.queryParam) - }).then(res => { - return res.result - }) - }, - - selectedRowKeys: [], - selectedRows: [] - } - }, - methods: { - handleEdit (record) { - this.mdl = Object.assign({}, record) - - this.mdl.permissions.forEach(permission => { - permission.actionsOptions = permission.actionEntitySet.map(action => { - return { label: action.describe, value: action.action, defaultCheck: action.defaultCheck } - }) - }) - - console.log(this.mdl) - this.visible = true - }, - handleOk () { - // 鏂板/淇敼 鎴愬姛鏃讹紝閲嶈浇鍒楄〃 - this.$refs.table.refresh() - }, - onChange (selectedRowKeys, selectedRows) { - this.selectedRowKeys = selectedRowKeys - this.selectedRows = selectedRows - }, - toggleAdvanced () { - this.advanced = !this.advanced - }, - }, - watch: { - /* - 'selectedRows': function (selectedRows) { - this.needTotalList = this.needTotalList.map(item => { - return { - ...item, - total: selectedRows.reduce( (sum, val) => { - return sum + val[item.dataIndex] - }, 0) - } - }) - } - */ - } - } -</script> \ No newline at end of file diff --git a/src/views/examples/list/StandardList.vue b/src/views/examples/list/StandardList.vue deleted file mode 100644 index 4868ce3..0000000 --- a/src/views/examples/list/StandardList.vue +++ /dev/null @@ -1,164 +0,0 @@ -<template> - <div> - <a-card :bordered="false"> - <a-row> - <a-col :sm="8" :xs="24"> - <head-info title="鎴戠殑寰呭姙" content="8涓换鍔�" :bordered="true"/> - </a-col> - <a-col :sm="8" :xs="24"> - <head-info title="鏈懆浠诲姟骞冲潎澶勭悊鏃堕棿" content="32鍒嗛挓" :bordered="true"/> - </a-col> - <a-col :sm="8" :xs="24"> - <head-info title="鏈懆瀹屾垚浠诲姟鏁�" content="24涓�"/> - </a-col> - </a-row> - </a-card> - - <a-card - style="margin-top: 24px" - :bordered="false" - title="鏍囧噯鍒楄〃"> - - <div slot="extra"> - <a-radio-group> - <a-radio-button>鍏ㄩ儴</a-radio-button> - <a-radio-button>杩涜涓�</a-radio-button> - <a-radio-button>绛夊緟涓�</a-radio-button> - </a-radio-group> - <a-input-search style="margin-left: 16px; width: 272px;" /> - </div> - - <div class="operate"> - <a-button type="dashed" style="width: 100%" icon="plus">娣诲姞</a-button> - </div> - - <a-list size="large" :pagination="{showSizeChanger: true, showQuickJumper: true, pageSize: 5, total: 50}"> - <a-list-item :key="index" v-for="(item, index) in data"> - <a-list-item-meta :description="item.description"> - <a-avatar slot="avatar" size="large" shape="square" :src="item.avatar"/> - <a slot="title">{{ item.title }}</a> - </a-list-item-meta> - <div slot="actions"> - <a>缂栬緫</a> - </div> - <div slot="actions"> - <a-dropdown> - <a-menu slot="overlay"> - <a-menu-item><a>缂栬緫</a></a-menu-item> - <a-menu-item><a>鍒犻櫎</a></a-menu-item> - </a-menu> - <a>鏇村<a-icon type="down"/></a> - </a-dropdown> - </div> - <div class="list-content"> - <div class="list-content-item"> - <span>Owner</span> - <p>{{ item.owner }}</p> - </div> - <div class="list-content-item"> - <span>寮�濮嬫椂闂�</span> - <p>{{ item.startAt }}</p> - </div> - <div class="list-content-item"> - <a-progress :percent="item.progress.value" :status="!item.progress.status ? null : item.progress.status" style="width: 180px" /> - </div> - </div> - </a-list-item> - </a-list> - - </a-card> - </div> -</template> - -<script> - import HeadInfo from '@/components/tools/HeadInfo' - - const data = [] - data.push({ - title: 'Alipay', - avatar: 'https://gw.alipayobjects.com/zos/rmsportal/WdGqmHpayyMjiEhcKoVE.png', - description: '閭f槸涓�绉嶅唴鍦ㄧ殑涓滆タ锛� 浠栦滑鍒拌揪涓嶄簡锛屼篃鏃犳硶瑙﹀強鐨�', - owner: '浠樻檽鏅�', - startAt: '2018-07-26 22:44', - progress: { - value: 90 - } - }) - data.push({ - title: 'Angular', - avatar: 'https://gw.alipayobjects.com/zos/rmsportal/zOsKZmFRdUtvpqCImOVY.png', - description: '甯屾湜鏄竴涓ソ涓滆タ锛屼篃璁告槸鏈�濂界殑锛屽ソ涓滆タ鏄笉浼氭秷浜$殑', - owner: '鏇蹭附涓�', - startAt: '2018-07-26 22:44', - progress: { - value: 54 - } - }) - data.push({ - title: 'Ant Design', - avatar: 'https://gw.alipayobjects.com/zos/rmsportal/dURIMkkrRFpPgTuzkwnB.png', - description: '鐢熷懡灏卞儚涓�鐩掑阀鍏嬪姏锛岀粨鏋滃線寰�鍑轰汉鎰忔枡', - owner: '鏋椾笢涓�', - startAt: '2018-07-26 22:44', - progress: { - value: 66 - } - }) - data.push({ - title: 'Ant Design Pro', - avatar: 'https://gw.alipayobjects.com/zos/rmsportal/sfjbOqnsXXJgNCjCzDBL.png', - description: '鍩庨晣涓湁閭d箞澶氱殑閰掗锛屽ス鍗村亸鍋忚蛋杩涗簡鎴戠殑閰掗', - owner: '鍛ㄦ槦鏄�', - startAt: '2018-07-26 22:44', - progress: { - value: 30 - } - }) - data.push({ - title: 'Bootstrap', - avatar: 'https://gw.alipayobjects.com/zos/rmsportal/siCrBXXhmvTQGWPNLBow.png', - description: '閭f椂鍊欐垜鍙細鎯宠嚜宸辨兂瑕佷粈涔堬紝浠庝笉鎯宠嚜宸辨嫢鏈変粈涔�', - owner: '鍚村姞濂�', - startAt: '2018-07-26 22:44', - progress: { - status: 'exception', - value: 100 - } - }) - - export default { - name: "StandardList", - components: { - HeadInfo - }, - data () { - return { - data - } - } - } -</script> - -<style lang="less" scoped> - .ant-avatar-lg { - width: 48px; - height: 48px; - line-height: 48px; - } - - .list-content-item { - color: rgba(0, 0, 0, .45); - display: inline-block; - vertical-align: middle; - font-size: 14px; - margin-left: 40px; - span { - line-height: 20px; - } - p { - margin-top: 4px; - margin-bottom: 0; - line-height: 22px; - } - } -</style> \ No newline at end of file diff --git a/src/views/examples/list/TableInnerEditList.vue b/src/views/examples/list/TableInnerEditList.vue deleted file mode 100644 index db7d9d4..0000000 --- a/src/views/examples/list/TableInnerEditList.vue +++ /dev/null @@ -1,288 +0,0 @@ -<template> - <a-card :bordered="false"> - <div class="table-page-search-wrapper"> - <a-form layout="inline"> - <a-row :gutter="48"> - <a-col :md="8" :sm="24"> - <a-form-item label="瑙勫垯缂栧彿"> - <a-input placeholder=""/> - </a-form-item> - </a-col> - <a-col :md="8" :sm="24"> - <a-form-item label="浣跨敤鐘舵��"> - <a-select placeholder="璇烽�夋嫨" default-value="0"> - <a-select-option value="0">鍏ㄩ儴</a-select-option> - <a-select-option value="1">鍏抽棴</a-select-option> - <a-select-option value="2">杩愯涓�</a-select-option> - </a-select> - </a-form-item> - </a-col> - <template v-if="advanced"> - <a-col :md="8" :sm="24"> - <a-form-item label="璋冪敤娆℃暟"> - <a-input-number style="width: 100%"/> - </a-form-item> - </a-col> - <a-col :md="8" :sm="24"> - <a-form-item label="鏇存柊鏃ユ湡"> - <a-date-picker style="width: 100%" placeholder="璇疯緭鍏ユ洿鏂版棩鏈�"/> - </a-form-item> - </a-col> - <a-col :md="8" :sm="24"> - <a-form-item label="浣跨敤鐘舵��"> - <a-select placeholder="璇烽�夋嫨" default-value="0"> - <a-select-option value="0">鍏ㄩ儴</a-select-option> - <a-select-option value="1">鍏抽棴</a-select-option> - <a-select-option value="2">杩愯涓�</a-select-option> - </a-select> - </a-form-item> - </a-col> - <a-col :md="8" :sm="24"> - <a-form-item label="浣跨敤鐘舵��"> - <a-select placeholder="璇烽�夋嫨" default-value="0"> - <a-select-option value="0">鍏ㄩ儴</a-select-option> - <a-select-option value="1">鍏抽棴</a-select-option> - <a-select-option value="2">杩愯涓�</a-select-option> - </a-select> - </a-form-item> - </a-col> - </template> - <a-col :md="!advanced && 8 || 24" :sm="24"> - <span class="table-page-search-submitButtons" :style="advanced && { float: 'right', overflow: 'hidden' } || {} "> - <a-button type="primary">鏌ヨ</a-button> - <a-button style="margin-left: 8px">閲嶇疆</a-button> - <a @click="toggleAdvanced" style="margin-left: 8px"> - {{ advanced ? '鏀惰捣' : '灞曞紑' }} - <a-icon :type="advanced ? 'up' : 'down'"/> - </a> - </span> - </a-col> - </a-row> - </a-form> - </div> - - <div class="table-operator"> - <a-button type="primary" icon="plus" @click="() => this.handleModalVisible(true)">鏂板缓</a-button> - <a-dropdown v-if="selectedRowKeys.length > 0"> - <a-menu slot="overlay"> - <a-menu-item key="1"><a-icon type="delete" />鍒犻櫎</a-menu-item> - <!-- lock | unlock --> - <a-menu-item key="2"><a-icon type="lock" />閿佸畾</a-menu-item> - </a-menu> - <a-button style="margin-left: 8px"> - 鎵归噺鎿嶄綔 <a-icon type="down" /> - </a-button> - </a-dropdown> - </div> - - <s-table - ref="table" - size="default" - :columns="columns" - :data="loadData" - :showAlertInfo="true" - @onSelect="onChange" - > - <template v-for="(col, index) in columns" v-if="col.scopedSlots" :slot="col.dataIndex" slot-scope="text, record, index"> - <div :key="index"> - <a-input - v-if="record.editable" - style="margin: -5px 0" - :value="text" - @change="e => handleChange(e.target.value, record.key, col)" - /> - <template v-else>{{ text }}</template> - </div> - </template> - <template slot="action" slot-scope="text, record, index"> - <div class="editable-row-operations"> - <span v-if="record.editable"> - <a @click="() => save(record)">淇濆瓨</a> - <a-divider type="vertical" /> - <a-popconfirm title="鐪熺殑鏀惧純缂栬緫鍚�?" @confirm="() => cancel(record)"> - <a>鍙栨秷</a> - </a-popconfirm> - </span> - <span v-else> - <a class="edit" @click="() => edit(record)">淇敼</a> - <a-divider type="vertical" /> - <a class="delete" @click="() => del(record)">鍒犻櫎</a> - </span> - </div> - </template> - </s-table> - <a-modal title="鏂板缓瑙勫垯" destroyOnClose :visible="visibleCreateModal" @ok="handleCreateModalOk" @cancel="handleCreateModalCancel"> - <!----> - <a-form style="margin-top: 8px" :autoFormCreate="(form)=>{this.createForm = form}"> - <a-form-item :labelCol="{ span: 5 }" :wrapperCol="{ span: 15 }" label="鎻忚堪" fieldDecoratorId="description" :fieldDecoratorOptions="{rules: [{ required: true, message: '璇疯緭鍏ヨ嚦灏戜簲涓瓧绗︾殑瑙勫垯鎻忚堪锛�', min: 5 }]}"> - <a-input placeholder="璇疯緭鍏�" /> - </a-form-item> - </a-form> - </a-modal> - </a-card> -</template> - -<script> - import STable from '@/components/table/' - - export default { - name: "TableList", - components: { - STable - }, - data () { - return { - // 楂樼骇鎼滅储 灞曞紑/鍏抽棴 - advanced: false, - // 鏌ヨ鍙傛暟 - queryParam: {}, - // 琛ㄥご - columns: [ - { - title: '瑙勫垯缂栧彿', - dataIndex: 'no', - width: 90 - }, - { - title: '鎻忚堪', - dataIndex: 'description', - scopedSlots: { customRender: 'description' }, - }, - { - title: '鏈嶅姟璋冪敤娆℃暟', - dataIndex: 'callNo', - width: '150px', - sorter: true, - needTotal: true, - scopedSlots: { customRender: 'callNo' }, - // customRender: (text) => text + ' 娆�' - }, - { - title: '鐘舵��', - dataIndex: 'status', - width: '100px', - needTotal: true, - scopedSlots: { customRender: 'status' }, - }, - { - title: '鏇存柊鏃堕棿', - dataIndex: 'updatedAt', - width: '150px', - sorter: true, - scopedSlots: { customRender: 'updatedAt' }, - }, - { - table: '鎿嶄綔', - dataIndex: 'action', - width: '120px', - scopedSlots: { customRender: 'action' }, - } - ], - // 鍔犺浇鏁版嵁鏂规硶 蹇呴』涓� Promise 瀵硅薄 - loadData: parameter => { - return this.$http.get('/mock/api/service', { - params: Object.assign(parameter, this.queryParam) - }).then(res => { - return res.result - }) - }, - - selectedRowKeys: [], - selectedRows: [], - visibleCreateModal:false - } - }, - methods: { - - handleChange (value, key, column) { - console.log(value, key, column) - }, - edit (row) { - row.editable = true - // row = Object.assign({}, row) - this.$refs.table.updateEdit() - }, - // eslint-disable-next-line - del (row) { - this.$confirm({ - title: '璀﹀憡', - content: '鐪熺殑瑕佸垹闄ゅ悧?', - okText: '鍒犻櫎', - okType: 'danger', - cancelText: '鍙栨秷', - onOk() { - console.log('OK'); - // 鍦ㄨ繖閲岃皟鐢ㄥ垹闄ゆ帴鍙� - return new Promise((resolve, reject) => { - setTimeout(Math.random() > 0.5 ? resolve : reject, 1000); - }).catch(() => console.log('Oops errors!')); - }, - onCancel() { - console.log('Cancel'); - }, - }); - }, - save (row) { - delete row.editable - this.$refs.table.updateEdit() - }, - cancel (row) { - delete row.editable - this.$refs.table.updateEdit() - }, - - onChange (row) { - this.selectedRowKeys = row.selectedRowKeys - this.selectedRows = row.selectedRows - }, - toggleAdvanced () { - this.advanced = !this.advanced - }, - //娣诲姞閫昏緫 - handleModalVisible(isVisible) { - this.visibleCreateModal = isVisible; - }, - handleCreateModalCancel() { - this.visibleCreateModal = false; - }, - handleCreateModalOk() { - this.visibleCreateModal = false; - }, - }, - watch: { - /* - 'selectedRows': function (selectedRows) { - this.needTotalList = this.needTotalList.map(item => { - return { - ...item, - total: selectedRows.reduce( (sum, val) => { - return sum + val[item.dataIndex] - }, 0) - } - }) - } - */ - } - } -</script> - -<style lang="less" scoped> - .search { - margin-bottom: 54px; - } - - .fold { - width: calc(100% - 216px); - display: inline-block - } - - .operator { - margin-bottom: 18px; - } - - @media screen and (max-width: 900px) { - .fold { - width: 100%; - } - } -</style> \ No newline at end of file diff --git a/src/views/examples/list/TableList.vue b/src/views/examples/list/TableList.vue deleted file mode 100644 index ac9e064..0000000 --- a/src/views/examples/list/TableList.vue +++ /dev/null @@ -1,337 +0,0 @@ -<template> - <a-card :bordered="false"> - <div class="table-page-search-wrapper"> - <a-form layout="inline"> - <a-row :gutter="48"> - <a-col :md="8" :sm="24"> - <a-form-item label="瑙勫垯缂栧彿"> - <a-input v-model="queryParam.id" placeholder=""/> - </a-form-item> - </a-col> - <a-col :md="8" :sm="24"> - <a-form-item label="浣跨敤鐘舵��"> - <a-select v-model="queryParam.status" placeholder="璇烽�夋嫨" default-value="0"> - <a-select-option value="0">鍏ㄩ儴</a-select-option> - <a-select-option value="1">鍏抽棴</a-select-option> - <a-select-option value="2">杩愯涓�</a-select-option> - </a-select> - </a-form-item> - </a-col> - <template v-if="advanced"> - <a-col :md="8" :sm="24"> - <a-form-item label="璋冪敤娆℃暟"> - <a-input-number v-model="queryParam.callNo" style="width: 100%"/> - </a-form-item> - </a-col> - <a-col :md="8" :sm="24"> - <a-form-item label="鏇存柊鏃ユ湡"> - <a-date-picker v-model="queryParam.date" style="width: 100%" placeholder="璇疯緭鍏ユ洿鏂版棩鏈�"/> - </a-form-item> - </a-col> - <a-col :md="8" :sm="24"> - <a-form-item label="浣跨敤鐘舵��"> - <a-select v-model="queryParam.useStatus" placeholder="璇烽�夋嫨" default-value="0"> - <a-select-option value="0">鍏ㄩ儴</a-select-option> - <a-select-option value="1">鍏抽棴</a-select-option> - <a-select-option value="2">杩愯涓�</a-select-option> - </a-select> - </a-form-item> - </a-col> - <a-col :md="8" :sm="24"> - <a-form-item label="浣跨敤鐘舵��"> - <a-select placeholder="璇烽�夋嫨" default-value="0"> - <a-select-option value="0">鍏ㄩ儴</a-select-option> - <a-select-option value="1">鍏抽棴</a-select-option> - <a-select-option value="2">杩愯涓�</a-select-option> - </a-select> - </a-form-item> - </a-col> - </template> - <a-col :md="!advanced && 8 || 24" :sm="24"> - <span class="table-page-search-submitButtons" :style="advanced && { float: 'right', overflow: 'hidden' } || {} "> - <a-button type="primary">鏌ヨ</a-button> - <a-button style="margin-left: 8px" @click="resetSearchForm">閲嶇疆</a-button> - <a @click="toggleAdvanced" style="margin-left: 8px"> - {{ advanced ? '鏀惰捣' : '灞曞紑' }} - <a-icon :type="advanced ? 'up' : 'down'"/> - </a> - </span> - </a-col> - </a-row> - </a-form> - </div> - - <div class="table-operator"> - <a-button type="primary" icon="plus" @click="() => this.handleModalVisible(true)">鏂板缓</a-button> - <a-dropdown v-if="selectedRowKeys.length > 0"> - <a-menu slot="overlay"> - <a-menu-item key="1"><a-icon type="delete" />鍒犻櫎</a-menu-item> - <!-- lock | unlock --> - <a-menu-item key="2"><a-icon type="lock" />閿佸畾</a-menu-item> - </a-menu> - <a-button style="margin-left: 8px"> - 鎵归噺鎿嶄綔 <a-icon type="down" /> - </a-button> - </a-dropdown> - </div> - - <s-table - ref="table" - size="default" - :columns="columns" - :data="loadData" - :showAlertInfo="true" - @onSelect="onChange" - > - <span slot="action" slot-scope="text, record"> - <a @click="handleEdit(record)">缂栬緫</a> - <a-divider type="vertical" /> - <a-dropdown> - <a class="ant-dropdown-link"> - 鏇村 <a-icon type="down" /> - </a> - <a-menu slot="overlay"> - <a-menu-item> - <a href="javascript:;">璇︽儏</a> - </a-menu-item> - <a-menu-item> - <a href="javascript:;">绂佺敤</a> - </a-menu-item> - <a-menu-item> - <a href="javascript:;">鍒犻櫎</a> - </a-menu-item> - </a-menu> - </a-dropdown> - </span> - </s-table> - - <a-modal - title="鎿嶄綔" - :width="800" - v-model="visible" - @ok="handleOk" - > - <a-form :autoFormCreate="(form)=>{this.form = form}"> - - <a-form-item - :labelCol="labelCol" - :wrapperCol="wrapperCol" - label="瑙勫垯缂栧彿" - hasFeedback - validateStatus="success" - > - <a-input placeholder="瑙勫垯缂栧彿" v-model="mdl.no" id="no" /> - </a-form-item> - - <a-form-item - :labelCol="labelCol" - :wrapperCol="wrapperCol" - label="鏈嶅姟璋冪敤娆℃暟" - hasFeedback - validateStatus="success" - > - <a-input-number :min="1" id="callNo" v-model="mdl.callNo" style="width: 100%" /> - </a-form-item> - - <a-form-item - :labelCol="labelCol" - :wrapperCol="wrapperCol" - label="鐘舵��" - hasFeedback - validateStatus="warning" - > - <a-select defaultValue="1" v-model="mdl.status"> - <a-select-option value="1">Option 1</a-select-option> - <a-select-option value="2">Option 2</a-select-option> - <a-select-option value="3">Option 3</a-select-option> - </a-select> - </a-form-item> - - <a-form-item - :labelCol="labelCol" - :wrapperCol="wrapperCol" - label="鎻忚堪" - hasFeedback - help="璇峰~鍐欎竴娈垫弿杩�" - > - <a-textarea :rows="5" v-model="mdl.description" placeholder="..." id="description"/> - </a-form-item> - - <a-form-item - :labelCol="labelCol" - :wrapperCol="wrapperCol" - label="鏇存柊鏃堕棿" - hasFeedback - validateStatus="error" - > - <a-date-picker - style="width: 100%" - showTime - format="YYYY-MM-DD HH:mm:ss" - placeholder="Select Time" - /> - </a-form-item> - - </a-form> - </a-modal> - - <a-modal title="鏂板缓瑙勫垯" destroyOnClose :visible="visibleCreateModal" @ok="handleCreateModalOk" @cancel="handleCreateModalCancel"> - <!----> - <a-form style="margin-top: 8px" :autoFormCreate="(form)=>{this.createForm = form}"> - <a-form-item :labelCol="{ span: 5 }" :wrapperCol="{ span: 15 }" label="鎻忚堪" fieldDecoratorId="description" :fieldDecoratorOptions="{rules: [{ required: true, message: '璇疯緭鍏ヨ嚦灏戜簲涓瓧绗︾殑瑙勫垯鎻忚堪锛�', min: 5 }]}"> - <a-input placeholder="璇疯緭鍏�" /> - </a-form-item> - </a-form> - </a-modal> - - </a-card> -</template> - -<script> - import STable from '@/components/table/' - import ATextarea from "ant-design-vue/es/input/TextArea" - import AInput from "ant-design-vue/es/input/Input" - import moment from "moment" - import axios from 'axios'; - import { getRoleList, getServiceList } from '@/api/manage' - - export default { - name: "TableList", - components: { - AInput, - ATextarea, - STable - }, - data () { - return { - visibleCreateModal:false, - visible: false, - labelCol: { - xs: { span: 24 }, - sm: { span: 5 }, - }, - wrapperCol: { - xs: { span: 24 }, - sm: { span: 12 }, - }, - form: null, - mdl: {}, - - // 楂樼骇鎼滅储 灞曞紑/鍏抽棴 - advanced: true, - // 鏌ヨ鍙傛暟 - queryParam: {}, - // 琛ㄥご - columns: [ - { - title: '瑙勫垯缂栧彿', - dataIndex: 'no' - }, - { - title: '鎻忚堪', - dataIndex: 'description' - }, - { - title: '鏈嶅姟璋冪敤娆℃暟', - dataIndex: 'callNo', - sorter: true, - needTotal: true, - customRender: (text) => text + ' 娆�' - }, - { - title: '鐘舵��', - dataIndex: 'status', - needTotal: true - }, - { - title: '鏇存柊鏃堕棿', - dataIndex: 'updatedAt', - sorter: true - }, - { - table: '鎿嶄綔', - dataIndex: 'action', - width: '150px', - scopedSlots: { customRender: 'action' }, - } - ], - // 鍔犺浇鏁版嵁鏂规硶 蹇呴』涓� Promise 瀵硅薄 - loadData: parameter => { - return getServiceList(Object.assign(parameter, this.queryParam)) - .then(res => { - return res.result - }) - }, - - selectedRowKeys: [], - selectedRows: [] - } - }, - created () { - getRoleList({ t: new Date()}) - }, - methods: { - handleEdit (record) { - this.mdl = Object.assign({}, record) - console.log(this.mdl) - this.visible = true - }, - handleOk () { - - }, - - //娣诲姞閫昏緫 - handleModalVisible(isVisible) { - this.visibleCreateModal = isVisible; - }, - handleCreateModalOk() { - this.createForm.validateFields((err, fieldsValue) => { - if (err) { - return; - } - const description = this.createForm.getFieldValue('description'); - axios.post('/saveRule', { - desc: description, - }).then((res) => { - this.createForm.resetFields(); - this.visibleCreateModal = false; - this.loadRuleData(); - }); - }); - }, - handleCreateModalCancel() { - this.visibleCreateModal = false; - }, - - onChange (row) { - this.selectedRowKeys = row.selectedRowKeys - this.selectedRows = row.selectedRows - - console.log(this.$refs.table) - }, - toggleAdvanced () { - this.advanced = !this.advanced - }, - - resetSearchForm () { - this.queryParam = { - date: moment(new Date()) - } - } - }, - watch: { - /* - 'selectedRows': function (selectedRows) { - this.needTotalList = this.needTotalList.map(item => { - return { - ...item, - total: selectedRows.reduce( (sum, val) => { - return sum + val[item.dataIndex] - }, 0) - } - }) - } - */ - } - } -</script> \ No newline at end of file diff --git a/src/views/examples/list/UserList.vue b/src/views/examples/list/UserList.vue deleted file mode 100644 index 3e26ea8..0000000 --- a/src/views/examples/list/UserList.vue +++ /dev/null @@ -1,265 +0,0 @@ -<template> - <a-card :bordered="false"> - <div class="table-page-search-wrapper"> - <a-form layout="inline"> - <a-row :gutter="48"> - <a-col :md="8" :sm="24"> - <a-form-item label="瑙掕壊ID"> - <a-input placeholder="璇疯緭鍏�"/> - </a-form-item> - </a-col> - <a-col :md="8" :sm="24"> - <a-form-item label="鐘舵��"> - <a-select placeholder="璇烽�夋嫨" default-value="0"> - <a-select-option value="0">鍏ㄩ儴</a-select-option> - <a-select-option value="1">鍏抽棴</a-select-option> - <a-select-option value="2">杩愯涓�</a-select-option> - </a-select> - </a-form-item> - </a-col> - <a-col :md="8" :sm="24"> - <span class="table-page-search-submitButtons"> - <a-button type="primary">鏌ヨ</a-button> - <a-button style="margin-left: 8px">閲嶇疆</a-button> - </span> - </a-col> - </a-row> - </a-form> - </div> - - <s-table - size="default" - :columns="columns" - :data="loadData" - :scroll="{}" - > - <div - slot="expandedRowRender" - slot-scope="record" - style="margin: 0"> - <a-row - :gutter="24" - :style="{ marginBottom: '12px' }"> - <a-col :span="12" v-for="(role, index) in record.permissions" :key="index" :style="{ marginBottom: '12px' }"> - <a-col :lg="4" :md="24"> - <span>{{ role.permissionName }}锛�</span> - </a-col> - <a-col :lg="20" :md="24" v-if="role.actionEntitySet.length > 0"> - <a-tag color="cyan" v-for="(action, k) in role.actionEntitySet" :key="k">{{ action.describe }}</a-tag> - </a-col> - <a-col :span="20" v-else>-</a-col> - </a-col> - </a-row> - </div> - <span slot="action" slot-scope="text, record"> - <a @click="handleEdit(record)">缂栬緫</a> - <a-divider type="vertical" /> - <a-dropdown> - <a class="ant-dropdown-link"> - 鏇村 <a-icon type="down" /> - </a> - <a-menu slot="overlay"> - <a-menu-item> - <a href="javascript:;">璇︽儏</a> - </a-menu-item> - <a-menu-item> - <a href="javascript:;">绂佺敤</a> - </a-menu-item> - <a-menu-item> - <a href="javascript:;">鍒犻櫎</a> - </a-menu-item> - </a-menu> - </a-dropdown> - </span> - </s-table> - - <a-modal - title="鎿嶄綔" - style="top: 20px;" - :width="800" - v-model="visible" - @ok="handleOk" - > - <a-form :autoFormCreate="(form)=>{this.form = form}"> - - <a-form-item - :labelCol="labelCol" - :wrapperCol="wrapperCol" - label="鍞竴璇嗗埆鐮�" - hasFeedback - validateStatus="success" - > - <a-input placeholder="鍞竴璇嗗埆鐮�" v-model="mdl.id" id="no" disabled="disabled" /> - </a-form-item> - - <a-form-item - :labelCol="labelCol" - :wrapperCol="wrapperCol" - label="瑙掕壊鍚嶇О" - hasFeedback - validateStatus="success" - > - <a-input placeholder="璧蜂竴涓悕瀛�" v-model="mdl.name" id="role_name" /> - </a-form-item> - - <a-form-item - :labelCol="labelCol" - :wrapperCol="wrapperCol" - label="鐘舵��" - hasFeedback - validateStatus="warning" - > - <a-select v-model="mdl.status"> - <a-select-option value="1">姝e父</a-select-option> - <a-select-option value="2">绂佺敤</a-select-option> - </a-select> - </a-form-item> - - <a-form-item - :labelCol="labelCol" - :wrapperCol="wrapperCol" - label="鎻忚堪" - hasFeedback - > - <a-textarea :rows="5" v-model="mdl.describe" placeholder="..." id="describe"/> - </a-form-item> - - <a-divider /> - - <a-form-item - :labelCol="labelCol" - :wrapperCol="wrapperCol" - label="鎷ユ湁鏉冮檺" - hasFeedback - > - <a-row :gutter="16" v-for="(permission, index) in mdl.permissions" :key="index"> - <a-col :span="4"> - {{ permission.permissionName }}锛� - </a-col> - <a-col :span="20"> - <a-checkbox-group :options="permission.actionsOptions"/> - </a-col> - </a-row> - - </a-form-item> - - </a-form> - </a-modal> - - </a-card> -</template> - -<script> - import STable from '@/components/table/' - import { getRoleList, getServiceList } from '@/api/manage' - - export default { - name: "TableList", - components: { - STable - }, - data () { - return { - description: '鍒楄〃浣跨敤鍦烘櫙锛氬悗鍙扮鐞嗕腑鐨勬潈闄愮鐞嗕互鍙婅鑹茬鐞嗭紝鍙敤浜庡熀浜� RBAC 璁捐鐨勮鑹叉潈闄愭帶鍒讹紝棰楃矑搴︾粏鍒版瘡涓�涓搷浣滅被鍨嬨��', - - visible: false, - labelCol: { - xs: { span: 24 }, - sm: { span: 5 }, - }, - wrapperCol: { - xs: { span: 24 }, - sm: { span: 16 }, - }, - form: null, - mdl: {}, - - // 楂樼骇鎼滅储 灞曞紑/鍏抽棴 - advanced: false, - // 鏌ヨ鍙傛暟 - queryParam: {}, - // 琛ㄥご - columns: [ - { - title: '鍞竴璇嗗埆鐮�', - dataIndex: 'id' - }, - { - title: '瑙掕壊鍚嶇О', - dataIndex: 'name', - }, - { - title: '鐘舵��', - dataIndex: 'status' - }, - { - title: '鍒涘缓鏃堕棿', - dataIndex: 'createTime', - sorter: true - }, { - title: '鎿嶄綔', - width: '150px', - dataIndex: 'action', - scopedSlots: { customRender: 'action' }, - } - ], - // 鍔犺浇鏁版嵁鏂规硶 蹇呴』涓� Promise 瀵硅薄 - loadData: parameter => { - return getRoleList(parameter) - .then(res => { - return res.result - }) - }, - - selectedRowKeys: [], - selectedRows: [] - } - }, - created () { - getServiceList().then(res => { - console.log('getServiceList.call()', res) - }) - - getRoleList().then(res => { - console.log('getRoleList.call()', res) - }) - }, - methods: { - handleEdit (record) { - this.mdl = Object.assign({}, record) - - this.mdl.permissions.forEach(permission => { - permission.actionsOptions = permission.actionEntitySet.map(action => { - return { label: action.describe, value: action.action, defaultCheck: action.defaultCheck } - }) - }) - - this.visible = true - }, - handleOk () { - - }, - onChange (selectedRowKeys, selectedRows) { - this.selectedRowKeys = selectedRowKeys - this.selectedRows = selectedRows - }, - toggleAdvanced () { - this.advanced = !this.advanced - }, - }, - watch: { - /* - 'selectedRows': function (selectedRows) { - this.needTotalList = this.needTotalList.map(item => { - return { - ...item, - total: selectedRows.reduce( (sum, val) => { - return sum + val[item.dataIndex] - }, 0) - } - }) - } - */ - } - } -</script> \ No newline at end of file diff --git a/src/views/examples/list/modules/RoleModal.vue b/src/views/examples/list/modules/RoleModal.vue deleted file mode 100644 index 4f9f832..0000000 --- a/src/views/examples/list/modules/RoleModal.vue +++ /dev/null @@ -1,203 +0,0 @@ -<template> - <a-modal - title="鎿嶄綔" - :width="800" - :visible="visible" - :confirmLoading="confirmLoading" - @ok="handleOk" - @cancel="handleCancel" - > - <a-spin :spinning="confirmLoading"> - <a-form :form="form"> - - <a-form-item - :labelCol="labelCol" - :wrapperCol="wrapperCol" - label="鍞竴璇嗗埆鐮�" - hasFeedback - > - <a-input placeholder="鍞竴璇嗗埆鐮�" disabled="disabled" v-decorator="[ 'id', {rules: []} ]" /> - </a-form-item> - - <a-form-item - :labelCol="labelCol" - :wrapperCol="wrapperCol" - label="瑙掕壊鍚嶇О" - hasFeedback > - <a-input placeholder="璧蜂竴涓悕瀛�" v-decorator="[ 'name', {rules: [{ required: true, message: '涓嶈捣涓�涓悕瀛楀悧锛�' }] }]" /> - </a-form-item> - - <a-form-item - :labelCol="labelCol" - :wrapperCol="wrapperCol" - label="鐘舵��" - hasFeedback > - <a-select v-decorator="[ 'status', {rules: []} ]"> - <a-select-option :value="1">姝e父</a-select-option> - <a-select-option :value="2">绂佺敤</a-select-option> - </a-select> - </a-form-item> - - <a-form-item - :labelCol="labelCol" - :wrapperCol="wrapperCol" - label="鎻忚堪" - hasFeedback - > - <a-textarea :rows="5" placeholder="..." v-decorator="[ 'describe', { rules: [] } ]" /> - </a-form-item> - - <a-divider/> - - <a-form-item - :labelCol="labelCol" - :wrapperCol="wrapperCol" - label="鎷ユ湁鏉冮檺" - hasFeedback - > - <a-row :gutter="16" v-for="(permission, index) in permissions" :key="index"> - <a-col :span="4"> - {{ permission.name }}锛� - </a-col> - <a-col :span="20"> - <a-checkbox - v-if="permission.actionsOptions.length > 0" - :indeterminate="permission.indeterminate" - :checked="permission.checkedAll" - @change="onChangeCheckAll($event, permission)"> - 鍏ㄩ�� - </a-checkbox> - <a-checkbox-group :options="permission.actionsOptions" v-model="permission.selected" @change="onChangeCheck(permission)" /> - </a-col> - </a-row> - - </a-form-item> - </a-form> - </a-spin> - </a-modal> -</template> - -<script> - import { getPermissions } from '@/api/manage' - import { actionToObject } from '@/utils/permissions' - import pick from 'lodash.pick' - - export default { - name: "RoleModal", - data () { - return { - labelCol: { - xs: { span: 24 }, - sm: { span: 5 }, - }, - wrapperCol: { - xs: { span: 24 }, - sm: { span: 16 }, - }, - visible: false, - confirmLoading: false, - mdl: {}, - - form: this.$form.createForm(this), - permissions: [] - } - }, - created () { - this.loadPermissions() - }, - methods: { - add () { - this.edit({ id: 0 }) - }, - edit (record) { - this.mdl = Object.assign({}, record) - this.visible = true - - // 鏈夋潈闄愯〃锛屽鐞嗗嬀閫� - if (this.mdl.permissions && this.permissions) { - // 鍏堝鐞嗚鍕鹃�夌殑鏉冮檺缁撴瀯 - const permissionsAction = {} - this.mdl.permissions.forEach(permission => { - permissionsAction[permission.permissionId] = permission.actionEntitySet.map(entity => entity.action) - }) - // 鎶婃潈闄愯〃閬嶅巻涓�閬嶏紝璁惧畾瑕佸嬀閫夌殑鏉冮檺 action - this.permissions.forEach(permission => { - permission.selected = permissionsAction[permission.id] - }) - } - - this.$nextTick(() => { - this.form.setFieldsValue(pick(this.mdl, 'id', 'name', 'status', 'describe')) - }) - console.log('this.mdl', this.mdl) - - }, - close () { - this.$emit('close') - this.visible = false - }, - handleOk () { - const _this = this - // 瑙﹀彂琛ㄥ崟楠岃瘉 - this.form.validateFields((err, values) => { - // 楠岃瘉琛ㄥ崟娌¢敊璇� - if (!err) { - console.log('form values', values) - - _this.confirmLoading = true - // 妯℃嫙鍚庣璇锋眰 2000 姣寤惰繜 - new Promise((resolve) => { - setTimeout(() => resolve(), 2000) - }).then(() => { - // Do something - _this.$message.success('淇濆瓨鎴愬姛') - _this.$emit('ok') - }).catch(() => { - // Do something - }).finally(() => { - _this.confirmLoading = false - _this.close() - }) - } - }) - }, - handleCancel () { - this.close() - }, - onChangeCheck (permission) { - permission.indeterminate = !!permission.selected.length && (permission.selected.length < permission.actionsOptions.length) - permission.checkedAll = permission.selected.length === permission.actionsOptions.length - }, - onChangeCheckAll (e, permission) { - Object.assign(permission, { - selected: e.target.checked ? permission.actionsOptions.map(obj => obj.value) : [], - indeterminate: false, - checkedAll: e.target.checked - }) - }, - loadPermissions () { - getPermissions().then(res => { - let result = res.result - this.permissions = result.map(permission => { - const options = actionToObject(permission.actionData) - permission.checkedAll = false - permission.selected = [] - permission.indeterminate = false - permission.actionsOptions = options.map(option => { - return { - label: option.describe, - value: option.action - } - }) - return permission - }) - }) - } - - } - } -</script> - -<style scoped> - -</style> \ No newline at end of file diff --git a/src/views/examples/list/search/SearchLayout.vue b/src/views/examples/list/search/SearchLayout.vue deleted file mode 100644 index 7372018..0000000 --- a/src/views/examples/list/search/SearchLayout.vue +++ /dev/null @@ -1,78 +0,0 @@ -<template> - <div class="search-content"> - <router-view /> - </div> -</template> - -<script> - export default { - name: "SearchLayout", - data () { - return { - tabs: { - items: [ - { - key: '1', - title: '鏂囩珷' - }, - { - key: '2', - title: '椤圭洰' - }, - { - key: '3', - title: '搴旂敤' - }, - ], - active: () => { - switch (this.$route.path) { - case '/list/search/article': - return '1' - case '/list/search/project': - return '2' - case '/list/search/application': - return '3' - default: - return '1' - } - }, - callback: (key) => { - switch (key) { - case '1': - this.$router.push('/list/search/article') - break - case '2': - this.$router.push('/list/search/project') - break - case '3': - this.$router.push('/list/search/application') - break - default: - this.$router.push('/workplace') - } - } - }, - search: true - } - }, - computed: { - - }, - methods: { - } - } -</script> - -<style lang="less" scoped> - .search-head{ - background-color: #fff; - margin: -25px -24px -24px; - .search-input{ - text-align: center; - margin-bottom: 16px; - } - } - .search-content{ - margin-top: 48px; - } -</style> \ No newline at end of file diff --git a/src/views/examples/profile/advanced/Advanced.vue b/src/views/examples/profile/advanced/Advanced.vue deleted file mode 100644 index af44843..0000000 --- a/src/views/examples/profile/advanced/Advanced.vue +++ /dev/null @@ -1,342 +0,0 @@ -<template> - <page-layout title="鍗曞彿锛�234231029431" logo="https://gw.alipayobjects.com/zos/rmsportal/nxkuOJlFJuAUhzlMTCEe.png"> - - <detail-list slot="headerContent" size="small" :col="2" class="detail-layout"> - <detail-list-item term="鍒涘缓浜�">鏇蹭附涓�</detail-list-item> - <detail-list-item term="璁㈣喘浜у搧">XX鏈嶅姟</detail-list-item> - <detail-list-item term="鍒涘缓鏃堕棿">2018-08-07</detail-list-item> - <detail-list-item term="鍏宠仈鍗曟嵁"><a>12421</a></detail-list-item> - <detail-list-item term="鐢熸晥鏃ユ湡">2018-08-07 ~ 2018-12-11</detail-list-item> - <detail-list-item term="澶囨敞">璇蜂簬涓や釜宸ヤ綔鏃ュ唴纭</detail-list-item> - </detail-list> - <a-row slot="extra" class="status-list"> - <a-col :xs="12" :sm="12"> - <div class="text">鐘舵��</div> - <div class="heading">寰呭鎵�</div> - </a-col> - <a-col :xs="12" :sm="12"> - <div class="text">璁㈠崟閲戦</div> - <div class="heading">楼 568.08</div> - </a-col> - </a-row> - <!-- actions --> - <template slot="action"> - <a-button-group style="margin-right: 4px;"> - <a-button>鎿嶄綔</a-button> - <a-button>鎿嶄綔</a-button> - <a-button><a-icon type="ellipsis"/></a-button> - </a-button-group> - <a-button type="primary" >涓绘搷浣�</a-button> - </template> - - <a-card :bordered="false" title="娴佺▼杩涘害"> - <a-steps :direction="isMobile() && 'vertical' || 'horizontal'" :current="1" progressDot> - <a-step title="鍒涘缓椤圭洰"> - </a-step> - <a-step title="閮ㄩ棬鍒濆"> - </a-step> - <a-step title="璐㈠姟澶嶆牳"> - </a-step> - <a-step title="瀹屾垚"> - </a-step> - </a-steps> - </a-card> - - <a-card style="margin-top: 24px" :bordered="false" title="鐢ㄦ埛淇℃伅"> - <detail-list> - <detail-list-item term="鐢ㄦ埛濮撳悕">浠樻檽鏅�</detail-list-item> - <detail-list-item term="浼氬憳鍗″彿">32943898021309809423</detail-list-item> - <detail-list-item term="韬唤璇�">3321944288191034921</detail-list-item> - <detail-list-item term="鑱旂郴鏂瑰紡">18112345678</detail-list-item> - <detail-list-item term="鑱旂郴鍦板潃">娴欐睙鐪佹澀宸炲競瑗挎箹鍖洪粍濮戝北璺伐涓撹矾浜ゅ弶璺彛</detail-list-item> - </detail-list> - <detail-list title="淇℃伅缁�"> - <detail-list-item term="鏌愭煇鏁版嵁">725</detail-list-item> - <detail-list-item term="璇ユ暟鎹洿鏂版椂闂�">2018-08-08</detail-list-item> - <detail-list-item > </detail-list-item> - <detail-list-item term="鏌愭煇鏁版嵁">725</detail-list-item> - <detail-list-item term="璇ユ暟鎹洿鏂版椂闂�">2018-08-08</detail-list-item> - <detail-list-item > </detail-list-item> - </detail-list> - <a-card type="inner" title="澶氬眰淇℃伅缁�"> - <detail-list title="缁勫悕绉�" size="small"> - <detail-list-item term="璐熻矗浜�">鏋椾笢涓�</detail-list-item> - <detail-list-item term="瑙掕壊鐮�">1234567</detail-list-item> - <detail-list-item term="鎵�灞為儴闂�">XX鍏徃-YY閮�</detail-list-item> - <detail-list-item term="杩囨湡鏃堕棿">2018-08-08</detail-list-item> - <detail-list-item term="鎻忚堪">杩欐鎻忚堪寰堥暱寰堥暱寰堥暱寰堥暱寰堥暱寰堥暱寰堥暱寰堥暱寰堥暱寰堥暱寰堥暱寰堥暱寰堥暱寰堥暱...</detail-list-item> - </detail-list> - <a-divider style="margin: 16px 0" /> - <detail-list title="缁勫悕绉�" size="small" :col="1"> - <detail-list-item term="瀛﹀悕"> Citrullus lanatus (Thunb.) Matsum. et Nakai涓�骞寸敓钄撶敓钘ゆ湰锛涜寧銆佹灊绮楀.锛屽叿鏄庢樉鐨勬1銆傚嵎椤昏緝绮�..</detail-list-item> - </detail-list> - <a-divider style="margin: 16px 0" /> - <detail-list title="缁勫悕绉�" size="small" :col="2"> - <detail-list-item term="璐熻矗浜�">浠樺皬灏�</detail-list-item> - <detail-list-item term="瑙掕壊鐮�">1234567</detail-list-item> - </detail-list> - </a-card> - - </a-card> - - <a-card style="margin-top: 24px" :bordered="false" title="鐢ㄦ埛杩戝崐骞存潵鐢佃褰�"> - <div class="no-data"><a-icon type="frown-o"/>鏆傛棤鏁版嵁</div> - </a-card> - - <!-- 鎿嶄綔 --> - <a-card - style="margin-top: 24px" - :bordered="false" - :tabList="tabList" - :activeTabKey="activeTabKey" - @tabChange="(key) => {this.activeTabKey = key}" - > - <a-table - v-if="activeTabKey === '1'" - :columns="operationColumns" - :dataSource="operation1" - :pagination="false" - > - <template - slot="status" - slot-scope="status"> - <a-badge :status="status | statusTypeFilter" :text="status | statusFilter"/> - </template> - </a-table> - <a-table - v-if="activeTabKey === '2'" - :columns="operationColumns" - :dataSource="operation2" - :pagination="false" - > - <template - slot="status" - slot-scope="status"> - <a-badge :status="status | statusTypeFilter" :text="status | statusFilter"/> - </template> - </a-table> - <a-table - v-if="activeTabKey === '3'" - :columns="operationColumns" - :dataSource="operation3" - :pagination="false" - > - <template - slot="status" - slot-scope="status"> - <a-badge :status="status | statusTypeFilter" :text="status | statusFilter"/> - </template> - </a-table> - </a-card> - - </page-layout> -</template> - -<script> - import { mixinDevice } from '@/utils/mixin.js' - import PageLayout from '@/components/page/PageLayout' - import DetailList from '@/components/tools/DetailList' - - const DetailListItem = DetailList.Item - - export default { - name: "Advanced", - components: { - PageLayout, - DetailList, - DetailListItem - }, - mixins: [mixinDevice], - data () { - return { - tabList: [ - { - key: '1', - tab: '鎿嶄綔鏃ュ織涓�' - }, - { - key: '2', - tab: '鎿嶄綔鏃ュ織浜�' - }, - { - key: '3', - tab: '鎿嶄綔鏃ュ織涓�' - } - ], - activeTabKey: '1', - - operationColumns: [ - { - title: '鎿嶄綔绫诲瀷', - dataIndex: 'type', - key: 'type' - }, - { - title: '鎿嶄綔浜�', - dataIndex: 'name', - key: 'name' - }, - { - title: '鎵ц缁撴灉', - dataIndex: 'status', - key: 'status', - scopedSlots: { customRender: 'status' }, - }, - { - title: '鎿嶄綔鏃堕棿', - dataIndex: 'updatedAt', - key: 'updatedAt' - }, - { - title: '澶囨敞', - dataIndex: 'remark', - key: 'remark' - } - ], - operation1: [ - { - key: 'op1', - type: '璁㈣喘鍏崇郴鐢熸晥', - name: '鏇蹭附涓�', - status: 'agree', - updatedAt: '2017-10-03 19:23:12', - remark: '-' - }, - { - key: 'op2', - type: '璐㈠姟澶嶅', - name: '浠樺皬灏�', - status: 'reject', - updatedAt: '2017-10-03 19:23:12', - remark: '涓嶉�氳繃鍘熷洜' - }, - { - key: 'op3', - type: '閮ㄩ棬鍒濆', - name: '鍛ㄦ瘺姣�', - status: 'agree', - updatedAt: '2017-10-03 19:23:12', - remark: '-' - }, - { - key: 'op4', - type: '鎻愪氦璁㈠崟', - name: '鏋椾笢涓�', - status: 'agree', - updatedAt: '2017-10-03 19:23:12', - remark: '寰堟' - }, - { - key: 'op5', - type: '鍒涘缓璁㈠崟', - name: '姹楃墮鐗�', - status: 'agree', - updatedAt: '2017-10-03 19:23:12', - remark: '-' - } - ], - operation2: [ - { - key: 'op2', - type: '璐㈠姟澶嶅', - name: '浠樺皬灏�', - status: 'reject', - updatedAt: '2017-10-03 19:23:12', - remark: '涓嶉�氳繃鍘熷洜' - }, - { - key: 'op3', - type: '閮ㄩ棬鍒濆', - name: '鍛ㄦ瘺姣�', - status: 'agree', - updatedAt: '2017-10-03 19:23:12', - remark: '-' - }, - { - key: 'op4', - type: '鎻愪氦璁㈠崟', - name: '鏋椾笢涓�', - status: 'agree', - updatedAt: '2017-10-03 19:23:12', - remark: '寰堟' - } - ], - operation3: [ - { - key: 'op2', - type: '璐㈠姟澶嶅', - name: '浠樺皬灏�', - status: 'reject', - updatedAt: '2017-10-03 19:23:12', - remark: '涓嶉�氳繃鍘熷洜' - }, - { - key: 'op3', - type: '閮ㄩ棬鍒濆', - name: '鍛ㄦ瘺姣�', - status: 'agree', - updatedAt: '2017-10-03 19:23:12', - remark: '-' - } - ], - } - }, - filters: { - statusFilter(status) { - const statusMap = { - 'agree': '鎴愬姛', - 'reject': '椹冲洖' - } - return statusMap[status] - }, - statusTypeFilter(type) { - const statusTypeMap = { - 'agree': 'success', - 'reject': 'error' - } - return statusTypeMap[type] - } - } - } -</script> - -<style lang="less" scoped> - - .detail-layout { - margin-left: 44px; - } - .text { - color: rgba(0, 0, 0, .45); - } - - .heading { - color: rgba(0, 0, 0, .85); - font-size: 20px; - } - - .no-data { - color: rgba(0, 0, 0, .25); - text-align: center; - line-height: 64px; - font-size: 16px; - - i { - font-size: 24px; - margin-right: 16px; - position: relative; - top: 3px; - } - } - - .mobile { - .detail-layout { - margin-left: unset; - } - .text { - - } - .status-list { - text-align: left; - } - } -</style> \ No newline at end of file diff --git a/src/views/examples/profile/basic/Index.vue b/src/views/examples/profile/basic/Index.vue deleted file mode 100644 index 39dbd26..0000000 --- a/src/views/examples/profile/basic/Index.vue +++ /dev/null @@ -1,255 +0,0 @@ -<template> - <page-layout :title="title"> - <a-card :bordered="false"> - <detail-list title="閫�娆剧敵璇�"> - <detail-list-item term="鍙栬揣鍗曞彿">1000000000</detail-list-item> - <detail-list-item term="鐘舵��">宸插彇璐�</detail-list-item> - <detail-list-item term="閿�鍞崟鍙�">1234123421</detail-list-item> - <detail-list-item term="瀛愯鍗�">3214321432</detail-list-item> - </detail-list> - <a-divider style="margin-bottom: 32px"/> - <detail-list title="鐢ㄦ埛淇℃伅"> - <detail-list-item term="鐢ㄦ埛濮撳悕">浠樺皬灏�</detail-list-item> - <detail-list-item term="鑱旂郴鐢佃瘽">18100000000</detail-list-item> - <detail-list-item term="甯哥敤蹇��">鑿滈笩浠撳偍</detail-list-item> - <detail-list-item term="鍙栬揣鍦板潃">娴欐睙鐪佹澀宸炲競瑗挎箹鍖轰竾濉樿矾18鍙�</detail-list-item> - <detail-list-item term="澶囨敞"> 鏃�</detail-list-item> - </detail-list> - <a-divider style="margin-bottom: 32px"/> - - <div class="title">閫�璐у晢鍝�</div> - <s-table - style="margin-bottom: 24px" - :columns="goodsColumns" - :data="loadGoodsData"> - - </s-table> - - <div class="title">閫�璐ц繘搴�</div> - <s-table - style="margin-bottom: 24px" - :columns="scheduleColumns" - :data="loadScheduleData"> - - <template - slot="status" - slot-scope="status"> - <a-badge :status="status" :text="status | statusFilter"/> - </template> - - </s-table> - </a-card> - </page-layout> -</template> - -<script> - import PageLayout from '@/components/page/PageLayout' - import STable from '@/components/table/' - import DetailList from '@/components/tools/DetailList' - import ABadge from "ant-design-vue/es/badge/Badge" - const DetailListItem = DetailList.Item - - export default { - components: { - PageLayout, - ABadge, - DetailList, - DetailListItem, - STable - }, - data () { - return { - goodsColumns: [ - { - title: '鍟嗗搧缂栧彿', - dataIndex: 'id', - key: 'id' - }, - { - title: '鍟嗗搧鍚嶇О', - dataIndex: 'name', - key: 'name' - }, - { - title: '鍟嗗搧鏉$爜', - dataIndex: 'barcode', - key: 'barcode' - }, - { - title: '鍗曚环', - dataIndex: 'price', - key: 'price', - align: 'right' - }, - { - title: '鏁伴噺锛堜欢锛�', - dataIndex: 'num', - key: 'num', - align: 'right' - }, - { - title: '閲戦', - dataIndex: 'amount', - key: 'amount', - align: 'right' - } - ], - // 鍔犺浇鏁版嵁鏂规硶 蹇呴』涓� Promise 瀵硅薄 - loadGoodsData: () => { - return new Promise((resolve => { - resolve({ - data: [ - { - id: '1234561', - name: '鐭挎硥姘� 550ml', - barcode: '12421432143214321', - price: '2.00', - num: '1', - amount: '2.00' - }, - { - id: '1234562', - name: '鍑夎尪 300ml', - barcode: '12421432143214322', - price: '3.00', - num: '2', - amount: '6.00' - }, - { - id: '1234563', - name: '濂藉悆鐨勮柉鐗�', - barcode: '12421432143214323', - price: '7.00', - num: '4', - amount: '28.00' - }, - { - id: '1234564', - name: '鐗瑰埆濂藉悆鐨勮泲鍗�', - barcode: '12421432143214324', - price: '8.50', - num: '3', - amount: '25.50' - } - ], - pageSize: 10, - pageNo: 1, - totalPage: 1, - totalCount: 10 - }) - })).then(res => { - return res - }) - }, - - scheduleColumns: [ - { - title: '鏃堕棿', - dataIndex: 'time', - key: 'time' - }, - { - title: '褰撳墠杩涘害', - dataIndex: 'rate', - key: 'rate' - }, - { - title: '鐘舵��', - dataIndex: 'status', - key: 'status', - scopedSlots: { customRender: 'status' }, - }, - { - title: '鎿嶄綔鍛業D', - dataIndex: 'operator', - key: 'operator' - }, - { - title: '鑰楁椂', - dataIndex: 'cost', - key: 'cost' - } - ], - loadScheduleData: () => { - return new Promise((resolve => { - resolve({ - data: [ - { - key: '1', - time: '2017-10-01 14:10', - rate: '鑱旂郴瀹㈡埛', - status: 'processing', - operator: '鍙栬揣鍛� ID1234', - cost: '5mins' - }, - { - key: '2', - time: '2017-10-01 14:05', - rate: '鍙栬揣鍛樺嚭鍙�', - status: 'success', - operator: '鍙栬揣鍛� ID1234', - cost: '1h' - }, - { - key: '3', - time: '2017-10-01 13:05', - rate: '鍙栬揣鍛樻帴鍗�', - status: 'success', - operator: '鍙栬揣鍛� ID1234', - cost: '5mins' - }, - { - key: '4', - time: '2017-10-01 13:00', - rate: '鐢宠瀹℃壒閫氳繃', - status: 'success', - operator: '绯荤粺', - cost: '1h' - }, - { - key: '5', - time: '2017-10-01 12:00', - rate: '鍙戣捣閫�璐х敵璇�', - status: 'success', - operator: '鐢ㄦ埛', - cost: '5mins' - } - ], - pageSize: 10, - pageNo: 1, - totalPage: 1, - totalCount: 10 - }) - })).then(res => { - return res - }) - }, - } - }, - filters: { - statusFilter(status) { - const statusMap = { - 'processing': '杩涜涓�', - 'success': '瀹屾垚', - 'failed': '澶辫触' - } - return statusMap[status] - } - }, - computed: { - title () { - return this.$route.meta.title - } - }, - - } -</script> - -<style lang="less" scoped> - .title { - color: rgba(0,0,0,.85); - font-size: 16px; - font-weight: 500; - margin-bottom: 16px; - } -</style> \ No newline at end of file -- Gitblit v1.9.3