Commit 65b2e67c authored by 仇晓婷's avatar 仇晓婷

169bug

parent 1cf58dd0
...@@ -149,7 +149,9 @@ export default { ...@@ -149,7 +149,9 @@ export default {
}, },
watch: { watch: {
v() { v() {
console.log(v)
this.entity = this.$u.clone(this.v); this.entity = this.$u.clone(this.v);
this.selectAry();
}, },
}, },
}; };
......
<template> <template>
<div class="workiview"> <div class="workiview">
<DataGrid :columns="columns" ref="grid" :action="action" :high="false" :height="tableHeight" <DataGrid
@on-selection-change="selectionChange" > :columns="columns"
ref="grid"
:action="action"
:high="false"
:height="tableHeight"
@on-selection-change="selectionChange"
>
<template slot="easySearch"> <template slot="easySearch">
<Form ref="formInline" :model="easySearch" inline> <Form ref="formInline" :model="easySearch" inline>
<FormItem prop="keys"> <FormItem prop="keys">
<Input placeholder="请输入关键字日历名称/" v-model="easySearch.keys.value" /> <Input
placeholder="请输入关键字日历名称/"
v-model="easySearch.keys.value"
/>
</FormItem> </FormItem>
<FormItem> <FormItem>
<Button type="primary" @click="search">查询</Button> <Button type="primary" @click="search">查询</Button>
...@@ -20,11 +29,13 @@ ...@@ -20,11 +29,13 @@
</template> </template>
</DataGrid> </DataGrid>
<div class="footer02" v-if="footerModel"> <div class="footer02" v-if="footerModel">
<span class="span"> <span class="span">
已选择 已选择
<b class="span02">{{selectedRows.length}}</b> <b class="span02">{{ selectedRows.length }}</b>
</span> </span>
<Button @click="deleteMore" class="span ml20"><Icon type="md-close"/>批量删除</Button> <Button @click="deleteMore" class="span ml20"
><Icon type="md-close" />批量删除</Button
>
</div> </div>
<Modal v-model="addModal" ref="addmodal" title="新增" footer-hide> <Modal v-model="addModal" ref="addmodal" title="新增" footer-hide>
<Add ref="addModal" @on-close="cancel" @on-ok="addOk" /> <Add ref="addModal" @on-close="cancel" @on-ok="addOk" />
...@@ -32,183 +43,194 @@ ...@@ -32,183 +43,194 @@
<Modal v-model="editModal" title="编辑" footer-hide> <Modal v-model="editModal" title="编辑" footer-hide>
<Edit :eid="curId" @on-close="cancel" @on-ok="addOk" /> <Edit :eid="curId" @on-close="cancel" @on-ok="addOk" />
</Modal> </Modal>
<Modal v-model="deletelModal" title="删除" @on-ok="removeOk" @on-cancel="cancel"> <Modal
v-model="deletelModal"
title="删除"
@on-ok="removeOk"
@on-cancel="cancel"
>
<p>确定删除?</p> <p>确定删除?</p>
</Modal> </Modal>
<Modal v-model="deletelMore" title="批量删除"@on-ok="cancel" @on-cancel="cancel"> <Modal
<p>确定删除这{{selectedRows.length}}项么?</p> v-model="deletelMore"
</Modal> title="批量删除"
@on-ok="cancel"
@on-cancel="cancel"
>
<p>确定删除这{{ selectedRows.length }}项么?</p>
</Modal>
</div> </div>
</template> </template>
<script> <script>
import Api from './api' import Api from "./api";
import Add from './add' import Add from "./add";
import Edit from './edit' import Edit from "./edit";
import Detail from './detail' import Detail from "./detail";
import Search from './search' import Search from "./search";
export default { export default {
name: 'list', name: "list",
components: { components: {
Add, Add,
Edit, Edit,
Detail, Detail,
Search Search,
}, },
data() { data() {
return { return {
action: Api.index, action: Api.index,
easySearch: { easySearch: {
keys: { op: 'title,calendarClassTitle', value: null } keys: { op: "title,calendarClassTitle", value: null },
}, },
addModal: false, addModal: false,
editModal: false, editModal: false,
deletelModal: false, deletelModal: false,
selectedRows: [], //表格选中项 selectedRows: [], //表格选中项
tableHeight: '', tableHeight: "",
footerModel: false, footerModel: false,
deletelMore: false, deletelMore: false,
curId: 0, curId: 0,
columns: [ columns: [
// { type: 'selection', width: 70, align: 'center'}, // { type: 'selection', width: 70, align: 'center'},
{ key: 'id', title: this.l('id'), hide: true, align: 'left' }, { key: "id", title: this.l("id"), hide: true, align: "left" },
{ {
key: 'calId', key: "calId",
title: this.l('calId'), title: this.l("calId"),
high: true, high: true,
align: 'left' align: "left",
}, },
{ {
key: 'calName', key: "calName",
title: this.l('calName'), title: this.l("calName"),
high: true, high: true,
align: 'left' align: "left",
}, },
{ {
key: 'shiftName', key: "shiftName",
title: this.l('shiftName'), title: this.l("shiftName"),
high: true, high: true,
align: 'left' align: "left",
}, },
{ {
key: 'mesShiftWorkSchedIds', key: "mesShiftWorkSchedIds",
title: this.l('mesShiftWorkSchedIds'), title: this.l("mesShiftWorkSchedIds"),
hide: true, hide: true,
align: 'left' align: "left",
}, },
{ {
key: 'workingLong', key: "workingLong",
title: this.l('workingLong'), title: this.l("workingLong"),
high: true, high: true,
align: 'left' align: "left",
}, },
{ {
key: 'creationTime', key: "creationTime",
title: this.l('creationTime'), title: this.l("creationTime"),
hide: true, hide: true,
align: 'left' align: "left",
}, },
{ {
key: 'creatorUserId', key: "creatorUserId",
title: this.l('creatorUserId'), title: this.l("creatorUserId"),
hide: true, hide: true,
align: 'left' align: "left",
}, },
{ {
title: '操作', title: "操作",
key: 'id', key: "id",
width: 140, width: 140,
align: 'center', align: "center",
render: (h, params) => { render: (h, params) => {
return h('div', { class: 'action' }, [ return h("div", { class: "action" }, [
h( h(
'op', "op",
{ {
attrs: { oprate: 'edit' }, attrs: { oprate: "edit" },
on: { click: () => this.edit(params.row.id) } on: { click: () => this.edit(params.row.id) },
}, },
'编辑' "编辑"
), ),
h( h(
'op', "op",
{ {
attrs: { oprate: 'remove' }, attrs: { oprate: "remove" },
on: { click: () => this.remove(params.row.id) } on: { click: () => this.remove(params.row.id) },
}, },
'删除' "删除"
) ),
]) ]);
} },
} },
] ],
} };
}, },
created(){ created() {
this.tableHeight = window.innerHeight - 230 this.tableHeight = window.innerHeight - 230;
// this.$refs.addModal.entity = {}
}, },
mounted() { mounted() {
window.onresize = () => {///浏览器窗口大小变化 window.onresize = () => {
return (() => { ///浏览器窗口大小变化
window.screenHeight = window.innerHeight return (() => {
this.tableHeight = window.screenHeight - 230 window.screenHeight = window.innerHeight;
})() this.tableHeight = window.screenHeight - 230;
} })();
};
}, },
async fetch({ store, params }) { async fetch({ store, params }) {
await store.dispatch('loadDictionary') // 加载数据字典 await store.dispatch("loadDictionary"); // 加载数据字典
}, },
methods: { methods: {
addOk() { addOk() {
this.$refs.grid.load() this.$refs.grid.load();
this.addModal = false this.addModal = false;
this.$refs.addModal.entity = {} this.$refs.addModal.entity = {};
this.editModal = false this.editModal = false;
this.curId = 0 this.curId = 0;
}, },
addFn(){ addFn() {
this.addModal=true this.addModal = true;
this.$refs.addmodal.entity = {} this.$refs.addmodal.entity = {};
this.$refs.addModal.selectAry();
}, },
search() { search() {
this.$refs.grid.reload(this.easySearch) this.$refs.grid.reload(this.easySearch);
}, },
edit(id) { edit(id) {
this.editModal = true this.editModal = true;
this.curId = id this.curId = id;
}, },
remove(id) { remove(id) {
this.deletelModal = true this.deletelModal = true;
this.curId = id this.curId = id;
}, },
removeOk() { removeOk() {
Api.delete({ id: this.curId }).then((r) => { Api.delete({ id: this.curId }).then((r) => {
if (r.success) { if (r.success) {
this.$refs.grid.load() this.$refs.grid.load();
this.deletelModal = false this.deletelModal = false;
this.$Message.success('删除成功') this.$Message.success("删除成功");
} }
}) });
}, },
removeCancel() { removeCancel() {
this.deletelModal = false this.deletelModal = false;
}, },
cancel() { cancel() {
this.curId = 0 this.curId = 0;
this.addModal = false this.addModal = false;
this.$refs.addModal.entity = {} this.$refs.addModal.entity = {};
this.detailModal = false this.detailModal = false;
this.editModal = false this.editModal = false;
this.deletedlModal = false this.deletedlModal = false;
this.deletelMore = false this.deletelMore = false;
}, },
//多选处理--表格选择项变化方法 //多选处理--表格选择项变化方法
selectionChange(selection) { selectionChange(selection) {
this.selectedRows = selection this.selectedRows = selection;
this.footerModel = selection.length > 0 this.footerModel = selection.length > 0;
}, },
deleteMore(){ deleteMore() {
this.deletelMore = true this.deletelMore = true;
}, },
l(key) { l(key) {
/* /*
...@@ -229,20 +251,20 @@ export default { ...@@ -229,20 +251,20 @@ export default {
workHours:'工作时长', workHours:'工作时长',
} }
*/ */
let vkey = 'calendar_work' + '.' + key let vkey = "calendar_work" + "." + key;
return this.$t(vkey) || key return this.$t(vkey) || key;
} },
} },
} };
</script> </script>
<style lang="less"> <style lang="less">
.workiview{ .workiview {
.footer02{ .footer02 {
background: #4c5968; background: #4c5968;
opacity: 0.9; opacity: 0.9;
position: absolute; position: absolute;
bottom: 9px; bottom: 9px;
box-shadow: 0px -5px 6px rgba(0,0,0,0.3); box-shadow: 0px -5px 6px rgba(0, 0, 0, 0.3);
width: 86%; width: 86%;
z-index: 99; z-index: 99;
padding: 10px; padding: 10px;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment