|
@@ -36,7 +36,7 @@
|
|
|
</a-form>
|
|
|
</div>
|
|
|
|
|
|
- <!-- 新增 导入 到处 -->
|
|
|
+ <!-- 新增 导入 导出 -->
|
|
|
<div class="table-operator">
|
|
|
<a-button @click="addPlan" type="primary">新增</a-button>
|
|
|
<a-button type="primary" @click="myPlanExportXls('我的日程计划')">导出</a-button>
|
|
@@ -57,7 +57,8 @@
|
|
|
>
|
|
|
<a-button type="primary">导入</a-button>
|
|
|
</a-upload>
|
|
|
- <!-- v-if="selectedRowKeys.length > 0" -->
|
|
|
+
|
|
|
+ <!-- v-if="selectedRowKeys.length > 0" -->
|
|
|
<a-dropdown>
|
|
|
<a-menu slot="overlay">
|
|
|
<a-menu-item key="1" @click="batchDel">
|
|
@@ -72,43 +73,41 @@
|
|
|
</a-dropdown>
|
|
|
</div>
|
|
|
|
|
|
- <!-- table区域-begin -->
|
|
|
- <div>
|
|
|
- <a-alert type="info" showIcon style="margin-bottom: 16px;">
|
|
|
- <template slot="message">
|
|
|
- <span>已选择</span>
|
|
|
- <!-- {{ selectedRowKeys.length }} -->
|
|
|
- <a style="font-weight: 600;padding: 0 4px;">3</a>
|
|
|
- <span>项</span>
|
|
|
- <!-- v-if="selectedRowKeys.length > 0" -->
|
|
|
- <template>
|
|
|
- <a-divider type="vertical" />
|
|
|
- <a @click="onClearSelected">清空</a>
|
|
|
- </template>
|
|
|
+ <!-- table 开始-->
|
|
|
+ <a-alert type="info" showIcon style="margin-bottom: 16px;">
|
|
|
+ <template slot="message">
|
|
|
+ <span>已选择</span>
|
|
|
+ <!-- {{ selectedRowKeys.length }} -->
|
|
|
+ <a style="font-weight: 600;padding: 0 4px;">0</a>
|
|
|
+ <span>项</span>
|
|
|
+ <!-- v-if="selectedRowKeys.length>0" -->
|
|
|
+ <template>
|
|
|
+ <a-divider type="vertical" />
|
|
|
+ <a @click="onClearSelected">清空</a>
|
|
|
</template>
|
|
|
- </a-alert>
|
|
|
- <!-- table :loading="loading" -->
|
|
|
- <a-row>
|
|
|
- <a-table
|
|
|
- bordered
|
|
|
- :columns="columns"
|
|
|
- :dataSource="planDataList"
|
|
|
- :pagination="pagination"
|
|
|
- :row-key="record => record.id"
|
|
|
- :rowSelection="rowSelection"
|
|
|
- @change="handleTableChange"
|
|
|
- >
|
|
|
- <!-- 操作 -->
|
|
|
- <span slot="operationSlot" slot-scope="text, record">
|
|
|
- <a href="javascript:void(0);" @click="editPlan(record)"> 编辑 </a>
|
|
|
- <a-divider type="vertical" />
|
|
|
- <a-popconfirm title="确定删除吗?" ok-text="是" cancel-text="否">
|
|
|
- <a href="javascript:void(0);" @click="delPlan(record.id)" class="delRed"> 删除 </a>
|
|
|
- </a-popconfirm>
|
|
|
- </span>
|
|
|
- </a-table>
|
|
|
- </a-row>
|
|
|
- </div>
|
|
|
+ </template>
|
|
|
+ </a-alert>
|
|
|
+
|
|
|
+ <!-- 使用 rowKey 来指定数据的唯一标识 id -->
|
|
|
+ <a-table
|
|
|
+ bordered
|
|
|
+ :columns="columns"
|
|
|
+ :dataSource="planList"
|
|
|
+ :pagination="pagination"
|
|
|
+ :row-key="record => record.id"
|
|
|
+ :rowSelection="rowSelection"
|
|
|
+ @change="handleTableChange"
|
|
|
+ >
|
|
|
+ <!-- 操作 -->
|
|
|
+ <span slot="operationSlot" slot-scope="text, record">
|
|
|
+ <a href="javascript:void(0);" @click="editPlan(record)"> 编辑 </a>
|
|
|
+ <a-divider type="vertical" />
|
|
|
+ <a-popconfirm title="确定删除吗?" ok-text="是" cancel-text="否">
|
|
|
+ <a href="javascript:void(0);" @click="delPlan(record.id)" class="delRed"> 删除 </a>
|
|
|
+ </a-popconfirm>
|
|
|
+ </span>
|
|
|
+ </a-table>
|
|
|
+ <!-- table 结束-->
|
|
|
|
|
|
<!-- 新增日程弹框 :fatherMethod="search"-->
|
|
|
<save-plan ref="savePlan"></save-plan>
|
|
@@ -116,6 +115,8 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+// import moment from 'moment'
|
|
|
+import 'moment/locale/zh-cn'
|
|
|
import JEllipsis from '@/components/jeecg/JEllipsis'
|
|
|
import SavePlan from '@views/oa/my-plan/add/savePlan' // 子组件
|
|
|
|
|
@@ -126,7 +127,8 @@ export default {
|
|
|
return {
|
|
|
tokenHeader: {},
|
|
|
queryParam: {}, // 查询条件对象
|
|
|
- pagination: {}, // 分页
|
|
|
+ pagination: {}, // 分页 // 富文本内容
|
|
|
+ // planObj: {}, // 表单数据(回显)
|
|
|
// 表头
|
|
|
columns: [
|
|
|
{
|
|
@@ -162,7 +164,7 @@ export default {
|
|
|
width: '20%'
|
|
|
}
|
|
|
],
|
|
|
- planDataList: [
|
|
|
+ planList: [
|
|
|
{
|
|
|
id: '1',
|
|
|
title: '11月19日的KPI考核(2)',
|
|
@@ -194,12 +196,15 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
- // 选中项
|
|
|
+ // 选择功能的配置
|
|
|
rowSelection () {
|
|
|
return {
|
|
|
+ // 选中项发生变化时的回调
|
|
|
onChange: (selectedRowKeys, selectedRows) => {
|
|
|
- console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows)
|
|
|
+ console.log('勾选项的id:', selectedRowKeys)
|
|
|
+ console.log('勾选项对象数组:', selectedRows)
|
|
|
},
|
|
|
+ // 选择框的默认属性配置
|
|
|
getCheckboxProps: record => ({
|
|
|
props: {
|
|
|
disabled: record.title === 'Disabled User',
|
|
@@ -215,7 +220,25 @@ export default {
|
|
|
addPlan () {
|
|
|
console.log('点击了新增日程')
|
|
|
this.$refs.savePlan.savePlanModalVisible = true
|
|
|
+ this.$refs.savePlan.title = '新增日程计划'
|
|
|
},
|
|
|
+ // 编辑 (操作)
|
|
|
+ editPlan (obj) {
|
|
|
+ /* ------------------------------
|
|
|
+ 打开弹框、发送根据id查询、
|
|
|
+ 数据赋值到对象集合中、
|
|
|
+ 回显到表单、调用回显的方法,
|
|
|
+ 提示修改成功、刷新列表
|
|
|
+ ------------------------------- */
|
|
|
+ console.log('点击对象为:', obj)
|
|
|
+ this.$refs.savePlan.savePlanModalVisible = true
|
|
|
+ this.$refs.savePlan.title = '编辑日程计划'
|
|
|
+ this.$refs.savePlan.formData = obj
|
|
|
+ this.$refs.savePlan.getFormInfo()
|
|
|
+ },
|
|
|
+ // 操作 删除
|
|
|
+ delPlan () {},
|
|
|
+ // ------------------------------------------
|
|
|
// 查询按钮
|
|
|
searchQuery () {
|
|
|
// this.loading = true
|
|
@@ -234,11 +257,7 @@ export default {
|
|
|
// 批量删除
|
|
|
batchDel () {},
|
|
|
// 分页、排序、筛选变化时触发
|
|
|
- handleTableChange (pagination, filters, sorter) {},
|
|
|
- // 操作 编辑
|
|
|
- editPlan () {},
|
|
|
- // 操作 删除
|
|
|
- delPlan () {}
|
|
|
+ handleTableChange (pagination, filters, sorter) {}
|
|
|
}
|
|
|
}
|
|
|
</script>
|