Commit e2fb9534 authored by 周远喜's avatar 周远喜

ok

parent bf1f23c2
<template>
<div>
<div>
<Card>
<EditGrid :columns="columns" ref="grid" :items="list">
<template slot="easySearch">
<Form ref="formInline" :model="easySearch" inline>
<FormItem prop="keys"><Input placeholder="请输入关键字标题" v-model="easySearch.keys.value" /> </FormItem>
<FormItem><Button type="primary" @click="search">查询</Button>
</FormItem>
</Form>
</template>
<!-- <template slot="searchForm">
<EditGrid :columns="columns" ref="grid" :items="list"
>
<template slot="easySearch"><Form ref="formInline" :model="easySearch" inline><FormItem prop="keys"><Input placeholder="请输入关键字标题" v-model="easySearch.keys.value" /> </FormItem>
<FormItem><Button type="primary" @click="search">查询</Button>
</FormItem>
</Form></template>
<!-- <template slot="searchForm">
<Search />
</template> -->
<template slot="buttons">
<Button type="primary" @click="add(null)">新增</Button>
</template>
</EditGrid>
<template slot="buttons">
<Button type="primary" @click="add(null)">新增</Button>
</template>
</EditGrid>
</Card>
<Modal v-model="modal" :title="title" width="1200" footer-hide>
<component :is="detail" :eid="curId" :v="row" @on-close="cancel" @on-ok="ok" />
<component :is="detail" :eid="curId" :v="row" @on-close="cancel" @on-ok="ok" />
</Modal>
</div>
</div>
</template>
<script>
import Api from "./api";
import Search from "./search";
export default {
name: "list",
components: {
Search,
},
head: {
title: "项目计划",
author: "henq",
description: "project_plan 10/19/2020 10:23:07 AM",
name: "list",
components: {
Search,
},
head: {
title: "项目计划",
author: "henq",
description: "project_plan 10/19/2020 10:23:07 AM",
},
props:{
eid:{
type:String
},
props: {
eid: {
type: String
},
data: {
type: Object,
default: () => {
return {
id: "33930562-a9f7-bd95-88ab-d01eb1c4c369",
title: "示例项目"
}
}
}
},
data() {
data:{
type:Object,
default:()=>{
return {
entity: {},
row: {},
action: Api.index,
easySearch: {
keys: {
op: "title",
value: null
},
},
modal: false,
title: "新增",
detail: null,
curId: null,
list: [],
columns: [
// { key:"id",title:this.$t("id") ,hide:true ,align:"left" ,high:true },
// { key:"creationTime",title:this.l("creationTime") ,align:"left" ,high:true },
// { key:"creatorUserId",title:this.l("creatorUserId") ,align:"left" ,high:true },
// { key:"lastModificationTime",title:this.l("lastModificationTime") ,align:"left" ,high:true },
// { key:"lastModifierUserId",title:this.l("lastModifierUserId") ,align:"left" ,high:true },
// { key:"isDeleted",title:this.l("isDeleted") ,align:"left" ,high:true },
// { key:"deletionTime",title:this.l("deletionTime") ,align:"left" ,high:true },
// { key:"deleterUserId",title:this.l("deleterUserId") ,align:"left" ,high:true },
// { key:"projectId",title:this.l("projectId") ,align:"left" ,high:true },
// { key:"upId",title:this.l("upId") ,align:"left" ,high:true },
// { type: "selection", width: 80, align: "center" },
{
title: "操作",
key: "action",
width: 150,
align: "center",
// render:(h,params)=>{
// return h("Actions"
// ,{
// attrs:{
// row:params,
// },
// on:{
// 'on-click':this.rowclick
// }
// }
// )
// }
id:"33930562-a9f7-bd95-88ab-d01eb1c4c369",
title:"示例项目"
}
}
}
},
data() {
return {
entity:{},
row:{},
action: Api.index,
easySearch: {
keys: { op: "title", value: null },
},
modal: false,
title: "新增",
detail: null,
curId:null,
list: [],
columns: [
// { key:"id",title:this.$t("id") ,hide:true ,align:"left" ,high:true },
// { key:"creationTime",title:this.l("creationTime") ,align:"left" ,high:true },
// { key:"creatorUserId",title:this.l("creatorUserId") ,align:"left" ,high:true },
// { key:"lastModificationTime",title:this.l("lastModificationTime") ,align:"left" ,high:true },
// { key:"lastModifierUserId",title:this.l("lastModifierUserId") ,align:"left" ,high:true },
// { key:"isDeleted",title:this.l("isDeleted") ,align:"left" ,high:true },
// { key:"deletionTime",title:this.l("deletionTime") ,align:"left" ,high:true },
// { key:"deleterUserId",title:this.l("deleterUserId") ,align:"left" ,high:true },
// { key:"projectId",title:this.l("projectId") ,align:"left" ,high:true },
// { key:"upId",title:this.l("upId") ,align:"left" ,high:true },
// { type: "selection", width: 80, align: "center" },
{
title: "操作",
key: "action",
width: 150,
align: "center",
// render:(h,params)=>{
// return h("Actions"
// ,{
// attrs:{
// row:params,
render: (h, params) => {
return h("div", {
class: "action"
}, [
h(
"op", {
attrs: {
icon: "md-arrow-dropright-circle",
type: "icon",
title: "派发",
oprate: "edit",
},
on: {
click: () => this.copy(params.row.id)
},
},
),
h(
"op", {
attrs: {
icon: "md-add",
type: "icon",
title: "新增子任务",
oprate: "edit",
},
on: {
click: () => this.add(params.row)
},
}
),
h(
"op", {
attrs: {
icon: "md-eye",
type: "icon",
title: "编辑",
oprate: "edit",
},
on: {
click: () => this.edit(params.row.id)
},
}
),
h(
"op", {
attrs: {
icon: "ios-trash",
type: "icon",
title: "删除",
oprate: "delete",
msg: "确认要删除吗?"
},
on: {
click: () => this.remove(params.row.id)
},
}
),
]);
},
},
// },
// on:{
// 'on-click':this.rowclick
// }
// }
// )
// }
render: (h, params) => {
return h("div", { class: "action" }, [
h(
"op",
{
attrs: { icon: "md-arrow-dropright-circle",
type: "icon",
......@@ -166,14 +104,19 @@ export default {
},
on: { click: () => this.copy(params.row.id) },
},
),
h(
"op",
{
key: "title",
title: this.l("title"),
align: "left",
tree: true,
easy: true,
high: true,
},
attrs: { icon: "md-add",
type: "icon",
title: "新增子任务",
oprate: "edit",},
on: { click: () => this.add(params.row) },
}
),
h(
"op",
{
attrs: { icon: "md-create",
type: "icon",
......@@ -185,131 +128,163 @@ export default {
h(
"op",
{
key: "endDate",
title: this.l("endDate"),
align: "left",
high: true,
type: "date"
},
// {
// key: "attachment",
// title: this.l("attachment"),
// align: "left",
// high: true,
// },
{
key: "executor",
title: this.l("executor"),
align: "left",
high: true,
type: "users",
},
],
};
},
mounted() {
console.log(this);
this.search();
},
async fetch({
store,
params
}) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
methods: {
ok() {
this.search();
this.modal = false;
this.curId = null;
},
search() {
// this.$refs.grid.reload(this.easySearch);
var params = {
conditions: [{
fieldName: "projectId",
conditionalType: 'Equal',
fieldValue: this.eid
}],
// conditions: []
};
Api.list(params).then((r) => {
let res = r.result;
var data = this.$u.toTree(
res,
null,
(u) => {
// console.log(u);
u.expanded = true;
u.selected = false;
u.checked = false;
},
"upId"
);
this.list = data;
});
},
// rowclick(row,li){
// return {
// test(){
// alert(1);
// }
// }
// },
add(row) {
if (row) {
this.curId = row.id;
this.row = row
} else {
this.curId = null;
this.row = {
projectId: this.data.id,
attrs: { icon: "ios-trash",
type: "icon",
title: "删除",
oprate: "delete",
msg: "确认要删除吗?" },
on: { click: () => this.remove(params.row.id) },
}
}
this.title = "新增";
this.detail = () => import("./add");
this.modal = true;
},
copy(id) {
this.curId = id;
this.title = "克隆";
this.detail = () => import("./add");
this.modal = true;
),
]);
},
},
view(id) {
this.curId = id;
this.title = "详情";
this.detail = () => import("./detail");
this.modal = true;
{
key: "type",
width: 90,
title: this.l("type"),
align: "left",
high: true,
code: "mes.project_plan.Type",
},
edit(id) {
this.curId = id;
this.title = "编辑";
this.detail = () => import("./edit");
this.modal = true;
{
key: "title",
title: this.l("title"),
align: "left",
tree: true,
easy: true,
high: true,
},
remove(id) {
Api.delete(id).then((r) => {
if (r.success) {
this.search();
this.$Message.success("删除成功");
}
});
{
key: "status",
title: this.l("status"),
align: "left",
high: true,
code: "mes.project_plan.Status",
},
cancel() {
this.curId = null;
this.modal = false;
{
key: "startDate",
title: this.l("startDate"),
align: "left",
high: true
,type:"date"
},
l(key) {
let vkey = "project_plan" + "." + key;
return this.$t(vkey) || key;
{ key: "endDate", title: this.l("endDate"), align: "left", high: true,type:"date" },
// {
// key: "attachment",
// title: this.l("attachment"),
// align: "left",
// high: true,
// },
{
key: "executor",
title: this.l("executor"),
align: "left",
high: true,
type:"users",
},
],
};
},
mounted() {
console.log(this);
this.search();
},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
methods: {
ok() {
this.search();
this.modal = false;
this.curId = null;
},
search() {
// this.$refs.grid.reload(this.easySearch);
var params = {
conditions: [{
fieldName:"projectId",
conditionalType: 'Equal',
fieldValue:this.eid
}],
// conditions: []
};
Api.list(params).then((r) => {
let res = r.result;
var data = this.$u.toTree(
res,
null,
(u) => {
// console.log(u);
u.expanded = true;
u.selected = false;
u.checked = false;
},
"upId"
);
this.list =data;
});
},
// rowclick(row,li){
// return {
// test(){
// alert(1);
// }
// }
// },
add(row) {
if(row){
this.curId=row.id;
this.row=row
}else{
this.curId=null;
this.row={
projectId:this.data.id
}
}
this.title = "新增";
this.detail = () => import("./add");
this.modal = true;
},
copy(id) {
this.curId = id;
this.title = "克隆";
this.detail = () => import("./add");
this.modal = true;
},
view(id) {
this.curId = id;
this.title = "详情";
this.detail = () => import("./detail");
this.modal = true;
},
edit(id) {
this.curId = id;
this.title = "编辑";
this.detail = () => import("./edit");
this.modal = true;
},
remove(id) {
Api.delete(id).then((r) => {
if (r.success) {
this.search();
this.$Message.success("删除成功");
}
});
},
cancel() {
this.curId = null;
this.modal = false;
},
l(key) {
let vkey = "project_plan" + "." + key;
return this.$t(vkey) || key;
},
},
};
</script>
<style lang="less">
</style>
</style>
\ No newline at end of file
......@@ -14,33 +14,45 @@
<Filed :span="12" :name="l('endDate') + ':'">{{
entity.endDate
}}</Filed>
</Row>
</div>
<ul>
<li>
<a @click="details"> <Icon type="ios-log-in" />详情 </a>
&nbsp;
<span>|</span>
</li>
<li>
<a @click="template"> <Icon type="ios-photos" />模版</a>
&nbsp;
<span>|</span>
</li>
<li>
<a @click="task"> <Icon type="md-create" />任务 </a>
&nbsp;
<span>|</span>
</li>
<li>
<a @click="group"> <Icon type="md-create" />成员 </a>
<span>|</span>
</li>
<li>
<a @click="task"> <Icon type="md-create" />动态 </a>
<span>|</span>
</li>
</ul>
</Row>
</div>
<ul>
<li>
<a @click="details">
<Icon type="ios-log-in" />详情
</a>
&nbsp;
<span>|</span>
</li>
<li>
<a @click="template">
<Icon type="ios-photos" />模版
</a>
&nbsp;
<span>|</span>
</li>
<li>
<a @click="task">
<Icon type="md-create" />任务
</a>
&nbsp;
<span>|</span>
</li>
<li>
<a @click="groupUser">
<Icon type="md-create" />成员
</a>
&nbsp;
<span>|</span>
</li>
<li>
<a @click="task">
<Icon type="md-create" />动态
</a>
&nbsp;
<span>|</span>
</li>
</ul>
</div>
<div class="body-document">
<h4 v-text="title"></h4>
......@@ -91,14 +103,45 @@ export default {
}
this.detail = () => import("./details");
},
group() {
// this.curId = this.eid;
this.title = "成员管理";
this.detail = () => import("../groupUser/index1");
},
l(key) {
key = "project_main" + "." + key;
return this.$t(key);
methods: {
load(v) {
Api.get({
id: v
}).then((r) => {
this.entity = r.result;
// this.$emit("on-load");
});
},
details() {
this.title = "详细信息";
this.detail = () => import("./details");
},
template() {
// this.curId = this.eid;
this.title = "项目模板";
this.detail = () => import("../plan");
},
task() {
this.curId = this.eid;
this.title = "任务";
//this.detail = () => import("../task/index");
this.$router.push({
name: "project-task",
params: {
id: this.curId
}
});
},
groupUser() {
// this.curId = this.eid;
this.title = "任务";
// this.detail = () => import("./add");
},
l(key) {
key = "project_main" + "." + key;
return this.$t(key);
},
},
watch: {
eid(v) {
......
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