Commit f2494204 authored by renjintao's avatar renjintao

Merge branch 'product' of git.mes123.com:zhouyx/mes-ui into product-rjt

parents a7bb5066 30fd49e1
<template>
<div class="files-view">
<Tag v-for="(item, index) in nameList" :key="index" :name="item.id">
<a @click="downFile(item)" target="_blank">{{ item.fileName }}</a>
</Tag>
<Modal
v-model="modal"
title="查看"
width="800"
footer-hide
:mask-closable="false"
>
<div class="img">
<img :src="avatorPath" width="100%" height="100%" />
</div>
</Modal>
</div>
</template>
<script>
export default {
name: "",
data() {
return {
downUrl: fileUrlDown,
avatorPath: "",
nameList: [],
modal: false,
};
},
props: {
parms: {
type: [String, Object],
default: "",
},
},
mounted() {
if (this.parms.eid) {
this.filesList();
}
},
methods: {
filesList() {
//查询上传到文件服务器上的文件
this.$http.sysUser.getFile(this.parms).then((res) => {
if (res.data != [] && res.data.length > 0) {
var items = [];
res.data.forEach((data) => {
let objImag = {};
objImag.fileName = data.fileName;
objImag.filePath = data.downloadPath;
objImag.id = data.id;
objImag.fileType = data.fileType;
items.push(objImag);
});
this.nameList = items;
}
});
},
downFile(item) {
console.log(item);
if (
item.fileType == "jpg" ||
item.fileType == "gif" ||
item.fileType == "png"
) {
this.avatorPath = this.downUrl + item.filePath;
this.modal = true;
} else {
window.open(this.downUrl + item.filePath, "_blank");
}
},
},
watch: {
"parms.eid"(v) {
if (v) {
this.filesList();
}
},
},
};
</script>
<style lang="less">
.files-view {
}
</style>
...@@ -42,11 +42,13 @@ ...@@ -42,11 +42,13 @@
:key="item.id" :key="item.id"
v-show="show(item)" v-show="show(item)"
class="treetr" class="treetr"
:class="{ 'child-tr': item.parent }" :id="'tr' + index"
:draggable="drag" :draggable="drag"
@dragstart="dragstart($event, index, item)" @dragstart="dragstart($event, index, item)"
@dragover="dragover($event, index, item)"
@drop="dragdrop($event, index, item)" @drop="dragdrop($event, index, item)"
@dragenter="dragenter($event, index, item)"
@dragover="dragover($event, index, item)"
@dragleave="dragleave($event, index, item)"
> >
<td <td
v-for="(column, snum) in columns" v-for="(column, snum) in columns"
...@@ -54,8 +56,11 @@ ...@@ -54,8 +56,11 @@
:style="tdStyle(column)" :style="tdStyle(column)"
> >
<!-- 多选 --> <!-- 多选 -->
<label v-if="column.type === 'selection'" @click="handleCheckClick(item, $event, index)"> <label
<Checkbox v-model="item.checked" ></Checkbox> v-if="column.type === 'selection'"
@click="handleCheckClick(item, $event, index)"
>
<Checkbox v-model="item.checked"></Checkbox>
</label> </label>
<!-- 图标 --> <!-- 图标 -->
<div v-if="column.type === 'icon'"> <div v-if="column.type === 'icon'">
...@@ -168,7 +173,7 @@ ...@@ -168,7 +173,7 @@
</div> </div>
<!-- 树图标 --> <!-- 树图标 -->
<span @click="toggle(index, item)" v-if="snum == iconRow()"> <span @click="toggle(index, item)" v-if="snum == iconRow()">
<i v-html="item.spaceHtml"></i> <span v-html="item.spaceHtml"></span>
<a v-if="item.children && item.children.length > 0"> <a v-if="item.children && item.children.length > 0">
<i <i
class="ivu-icon" class="ivu-icon"
...@@ -220,15 +225,29 @@ export default { ...@@ -220,15 +225,29 @@ export default {
return []; return [];
}, },
}, },
data:{
type: Array,
default() {
return [];
},
},
root:{
type:[String,Number],
default:0,
},
parent:{
type:String,
default:"upId"
},
iconName: false, iconName: false,
drag:{ drag: {
type:Boolean, type: Boolean,
default:false default: false,
},
spaceWidth: {
type: Number,
default: 20,
}, },
spaceWidth:{
type:Number,
default:20
}
}, },
provide() { provide() {
return { return {
...@@ -238,7 +257,8 @@ export default { ...@@ -238,7 +257,8 @@ export default {
data() { data() {
return { return {
color: "#19be6b", color: "#19be6b",
all:true, all: true,
logs:[],
initItems: [], // 处理后数据数组 initItems: [], // 处理后数据数组
cloneColumns: [], // 处理后的表头数据 cloneColumns: [], // 处理后的表头数据
checkGroup: [], // 复选框数组 checkGroup: [], // 复选框数组
...@@ -247,7 +267,7 @@ export default { ...@@ -247,7 +267,7 @@ export default {
tdsWidth: 0, // td总宽 tdsWidth: 0, // td总宽
timer: false, // 控制监听时长 timer: false, // 控制监听时长
dataLength: 0, // 树形数据长度 dataLength: 0, // 树形数据长度
dragIndex:-1,//拖拽开始的序号 dragIndex: -1, //拖拽开始的序号
}; };
}, },
computed: { computed: {
...@@ -317,18 +337,52 @@ export default { ...@@ -317,18 +337,52 @@ export default {
slots() { slots() {
return this.$scopedSlots; return this.$scopedSlots;
}, },
//拖拽 //拖拽开始
dragstart(e,index, row ) { dragstart(e, index, row) {
this.dragIndex=index; this.dragIndex = index;
console.log(index) console.log(index);
}, },
dragover(e,index, row ) { //进入
e.preventDefault(); dragenter(e, index, row) {
var tr = document.getElementById("tr" + index);
tr.className += " move";
// console.warn("进入",e, e.clientY,tr.clientTop, tr.className);
}, },
dragdrop(e,index, row ) { // 悬浮
dragover(e, index, row) {
// console.warn("悬浮",e)
e.preventDefault();
// 鼠标Y
var my=e.clientY;
var ty=e.toElement.offsetTop;
var h=e.toElement.clientHeight;
var tr = document.getElementById("tr" + index);
if(tr.className.indexOf(" sort")==-1&&2.5*h<(my-ty)){
tr.className=tr.className.replace(" move"," sort")
}
// console.warn("在上边",my,ty,my-ty,h, tr.className);
this.logs.push({index,ty,my,h})
},
// 离开
dragleave(e, index, row) {
var tr = document.getElementById("tr" + index);
tr.className = tr.className.replace(" move", "").replace(" sort","");
console.warn("离开",e.clientY,e.toElement.offsetTop,e.toElement.clientHeight, tr.className);
},
//放下
dragdrop(e, index, row) {
event.preventDefault(); event.preventDefault();
this.$emit("on-drag-drop",this.dragIndex,index,this.initItems) var tr = document.getElementById("tr" + index);
tr.className = tr.className.replace(" move", "").replace(" sort","");
if (index != this.dragIndex) {
this.$emit("on-drag-drop", this.dragIndex, index, this.initItems);
}
console.log(JSON.stringify(this.logs))
}, },
/**
* @dragover="dragover($event, index, item)"
@dragleave="dragleave($event,index,item)"
*/
// 有无多选框折叠位置优化 // 有无多选框折叠位置优化
iconRow() { iconRow() {
var num = 0; var num = 0;
...@@ -339,6 +393,7 @@ export default { ...@@ -339,6 +393,7 @@ export default {
} }
return num; return num;
}, },
// 设置td宽度,td的align // 设置td宽度,td的align
tdStyle(column) { tdStyle(column) {
const style = {}; const style = {};
...@@ -454,7 +509,10 @@ export default { ...@@ -454,7 +509,10 @@ export default {
// 数据处理 增加自定义属性监听 // 数据处理 增加自定义属性监听
initData(items, level, parent) { initData(items, level, parent) {
// this.initItems = [] // this.initItems = []
let spaceHtml = "<i class='ms-tree-space' style='width:"+this.spaceWidth*level+"px'></i>"; let spaceHtml = "";
for (let i = 1; i < level; i++) {
spaceHtml += "<i class='ms-tree-space'></i>";
}
items.forEach((item, index) => { items.forEach((item, index) => {
item = Object.assign({}, item, { item = Object.assign({}, item, {
parent, parent,
...@@ -747,6 +805,16 @@ export default { ...@@ -747,6 +805,16 @@ export default {
tr.treetr:hover td { tr.treetr:hover td {
background: #f7f7f7; background: #f7f7f7;
} }
tr.move {
td {
background-color: blue;
}
}
tr.sort {
td {
border-top: 2px solid blue;
}
}
.ms-tree-space { .ms-tree-space {
position: relative; position: relative;
top: 1px; top: 1px;
......
<template> <template>
<Form ref="form" :model="entity" :rules="rules" :label-width="90"> <Form ref="form" :model="entity" :rules="rules" :label-width="90">
<Row> <Row>
<!-- <Col :span="12" <!-- <Col :span="12"
...@@ -42,15 +42,15 @@ ...@@ -42,15 +42,15 @@
<Col :span="12" <Col :span="12"
><FormItem :label="l('deleterUserId')" prop="deleterUserId"> ><FormItem :label="l('deleterUserId')" prop="deleterUserId">
<InputNumber v-model="entity.deleterUserId"></InputNumber> </FormItem <InputNumber v-model="entity.deleterUserId"></InputNumber> </FormItem
></Col> ></Col> -->
<Col :span="12" <Col :span="12"
><FormItem :label="l('projectId')" prop="projectId"> ><FormItem :label="l('projectId')" prop="projectId">
<InputNumber v-model="entity.projectId"></InputNumber> </FormItem <Input v-model="entity.projectId"></Input> </FormItem
></Col> ></Col>
<Col :span="12" <Col :span="12"
><FormItem :label="l('upId')" prop="upId"> ><FormItem :label="l('upId')" prop="upId">
<InputNumber v-model="entity.upId"></InputNumber> </FormItem <Input v-model="entity.upId"></Input> </FormItem
></Col> --> ></Col>
<Col :span="12" <Col :span="12"
><FormItem :label="l('title')" prop="title"> ><FormItem :label="l('title')" prop="title">
<Input v-model="entity.title"> </Input> </FormItem <Input v-model="entity.title"> </Input> </FormItem
...@@ -60,6 +60,7 @@ ...@@ -60,6 +60,7 @@
<Dictionary <Dictionary
code="mes.project_plan.Status" code="mes.project_plan.Status"
v-model="entity.status" v-model="entity.status"
type="radio"
></Dictionary> </FormItem ></Dictionary> </FormItem
></Col> ></Col>
<Col :span="24" <Col :span="24"
...@@ -89,11 +90,13 @@ ...@@ -89,11 +90,13 @@
<Dictionary <Dictionary
code="mes.project_plan.Type" code="mes.project_plan.Type"
v-model="entity.type" v-model="entity.type"
type="radio"
></Dictionary> </FormItem ></Dictionary> </FormItem
></Col> ></Col>
<Col :span="12" <Col :span="12"
><FormItem :label="l('attachment')" prop="attachment"> ><FormItem :label="l('attachment')" prop="attachment">
<Input v-model="entity.attachment"> </Input> </FormItem <!-- <files ref="refFile" parms="parms" v-model="entity.attachment" files />-->
</FormItem
></Col> ></Col>
<Col :span="12" <Col :span="12"
><FormItem :label="l('executor')" prop="executor"> ><FormItem :label="l('executor')" prop="executor">
...@@ -101,12 +104,13 @@ ...@@ -101,12 +104,13 @@
></Col> ></Col>
</Row> </Row>
<FormItem> <FormItem>
<Button type="primary" @click="handleSubmit" v-noClick>保存</Button> <Button type="primary" @click="handleSubmit" noClick
>保存</Button
>
<Button @click="handleClose" class="ml20">取消</Button> <Button @click="handleClose" class="ml20">取消</Button>
</FormItem> </FormItem>
</Form> </Form>
</template> </template><script>
<script>
import Api from "./api"; import Api from "./api";
export default { export default {
name: "Add", name: "Add",
...@@ -121,7 +125,7 @@ export default { ...@@ -121,7 +125,7 @@ export default {
// deletionTime: null, // deletionTime: null,
// deleterUserId: null, // deleterUserId: null,
projectId: "33930562-a9f7-bd95-88ab-d01eb1c4c369", projectId: "33930562-a9f7-bd95-88ab-d01eb1c4c369",
upId: "33930562-a9f7-bd95-88ab-d01eb1c4c369", upId: this.v.id,
title: "", title: "",
status: 0, status: 0,
note: "", note: "",
...@@ -131,6 +135,7 @@ export default { ...@@ -131,6 +135,7 @@ export default {
attachment: "", attachment: "",
executor: "", executor: "",
}, },
parmsName: "app=material&eid=1&name=ProjectPlan",
rules: { rules: {
name: [{ required: true, message: "必填", trigger: "blur" }], name: [{ required: true, message: "必填", trigger: "blur" }],
}, },
...@@ -138,12 +143,12 @@ export default { ...@@ -138,12 +143,12 @@ export default {
}, },
props: { props: {
v: Object, v: Object,
eid: Number, eid: String,
}, },
mounted() { mounted() {
if (this.eid > 0) { // if (this.eid) {
this.load(this.eid); // this.load(this.eid);
} // }
}, },
methods: { methods: {
handleSubmit() { handleSubmit() {
...@@ -184,9 +189,9 @@ export default { ...@@ -184,9 +189,9 @@ export default {
this.entity = this.$u.clone(this.v); this.entity = this.$u.clone(this.v);
}, },
eid(v) { eid(v) {
if (v) { // if (v) {
this.load(v); // this.load(v);
} // }
}, },
}, },
}; };
......
import Api from '@/plugins/request' import Api from '@/plugins/request'
export default { export default {
index: `${material}proje/ctplan/paged`, index: `${material}/projectplan/paged`,
paged(params) { paged(params) {
return Api.post(`${material}/projectplan/paged`, params); return Api.post(`${material}/projectplan/paged`, params);
}, },
......
...@@ -36,11 +36,9 @@ ...@@ -36,11 +36,9 @@
} }
} }
}, },
props: { props:["eid"],
eid: Number
},
mounted() { mounted() {
if (this.eid > 0) { if (this.eid) {
this.load(this.eid); this.load(this.eid);
} }
}, },
......
...@@ -5,34 +5,25 @@ ...@@ -5,34 +5,25 @@
<Icon type="ios-arrow-down" /> <Icon type="ios-arrow-down" />
</p> </p>
项目信息 项目信息
<Actions/> <op/>
<Actions />
</Card> </Card>
<Card> <Card>
<TreeGrid :columns="columns" ref="grid" :items="list" <TreeGrid :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="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>
<template slot="searchForm"> </Form></template>
<!-- <template slot="searchForm">
<Search /> <Search />
</template> </template> -->
<template slot="buttons"> <template slot="buttons">
<Button type="primary" @click="add">新增</Button> <Button type="primary" @click="add(null)">新增</Button>
</template> </template>
</TreeGrid> </TreeGrid>
</Card> </Card>
<Modal v-model="modal" :title="title" width="1200" footer-hide> <Modal v-model="modal" :title="title" width="1200" footer-hide>
<component :is="detail" :eid="curId" @on-close="cancel" @on-ok="ok" /> <component :is="detail" :eid="curId" :v="row" @on-close="cancel" @on-ok="ok" />
</Modal> </Modal>
</div> </div>
</template> </template>
...@@ -49,8 +40,21 @@ export default { ...@@ -49,8 +40,21 @@ export default {
author: "henq", author: "henq",
description: "project_plan 10/19/2020 10:23:07 AM", description: "project_plan 10/19/2020 10:23:07 AM",
}, },
props:{
v:{
type:Object,
default:()=>{
return {
id:"33930562-a9f7-bd95-88ab-d01eb1c4c369",
title:"示例项目"
}
}
}
},
data() { data() {
return { return {
entity:{},
row:{},
action: Api.index, action: Api.index,
easySearch: { easySearch: {
keys: { op: "title", value: null }, keys: { op: "title", value: null },
...@@ -58,10 +62,8 @@ export default { ...@@ -58,10 +62,8 @@ export default {
modal: false, modal: false,
title: "新增", title: "新增",
detail: null, detail: null,
curId: 0, curId:null,
list: [ list: [],
],
columns: [ columns: [
// { key:"id",title:this.$t("id") ,hide:true ,align:"left" ,high:true }, // { key:"id",title:this.$t("id") ,hide:true ,align:"left" ,high:true },
// { key:"creationTime",title:this.l("creationTime") ,align:"left" ,high:true }, // { key:"creationTime",title:this.l("creationTime") ,align:"left" ,high:true },
...@@ -73,58 +75,76 @@ export default { ...@@ -73,58 +75,76 @@ export default {
// { key:"deleterUserId",title:this.l("deleterUserId") ,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:"projectId",title:this.l("projectId") ,align:"left" ,high:true },
// { key:"upId",title:this.l("upId") ,align:"left" ,high:true }, // { key:"upId",title:this.l("upId") ,align:"left" ,high:true },
{ type: "selection", width: 80, align: "center" }, // { type: "selection", width: 80, align: "center" },
{ {
title: "操作", title: "操作",
key: "action", key: "action",
width: 150, width: 150,
align: "center", align: "center",
render:(h,params)=>{ // render:(h,params)=>{
return h("Actions" // return h("Actions"
,{ // ,{
attrs:{ // attrs:{
row:params, // row:params,
// },
// on:{
// 'on-click':this.rowclick
// }
// }
// )
// }
render: (h, params) => {
return h("div", { class: "action" }, [
h(
"op",
{
attrs: { icon: "ios-trash",
type: "icon",
title: "复制",
oprate: "add",
msg: "确认要移出排产吗?" },
on: { click: () => this.copy(params.row.id) },
}, },
on:{ ),
'on-click':this.rowclick h(
"op",
{
attrs: { icon: "md-add",
type: "icon",
title: "新增子任务",
oprate: "add",},
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) },
} }
// render: (h, params) => { ),
// return h("div", { class: "action" }, [ ]);
// h( },
// "op",
// {
// attrs: { oprate: "detail" },
// on: { click: () => this.view(params.row.id) },
// },
// "查看"
// ),
// //h('op', { attrs: { oprate: 'copy' }, on: { click: () => this.copy(params.row.id) } }, '克隆'),
// h(
// "op",
// {
// attrs: { oprate: "edit" },
// on: { click: () => this.edit(params.row.id) },
// },
// "编辑"
// ),
// h(
// "op",
// {
// attrs: { oprate: "delete" },
// on: { click: () => this.remove(params.row.id) },
// },
// "删除"
// ),
// ]);
// },
}, },
{ {
key: "type", key: "type",
width:90, width: 90,
title: this.l("type"), title: this.l("type"),
align: "left", align: "left",
high: true, high: true,
...@@ -182,18 +202,42 @@ export default { ...@@ -182,18 +202,42 @@ export default {
}, },
search() { search() {
// this.$refs.grid.reload(this.easySearch); // this.$refs.grid.reload(this.easySearch);
var params={ var params = {
conditions:[] conditions: [{
} fieldName:"projectId",
Api.list(params).then(r=>{ conditionalType: 'Equal',
this.list=r.result; fieldValue:this.v.id
}) }],
// conditions: []
};
Api.list(params).then((r) => {
let res = r.result;
var data = this.$u.toTree(
res,
"33930562-a9f7-bd95-88ab-d01eb1c4c369",
(u) => {
// console.log(u);
u.expanded = true;
u.selected = false;
u.checked = false;
}, },
rowclick(row,li){ "upId"
console.warn("rowclick",row,li); );
this.list =data;
});
}, },
add() { // rowclick(row,li){
this.curId = 0; // return {
// test(){
// alert(1);
// }
// }
// },
add(row) {
this.curId=row.id;
this.row=row
this.title = "新增"; this.title = "新增";
this.detail = () => import("./add"); this.detail = () => import("./add");
this.modal = true; this.modal = true;
......
<template>
<div>
<DataGrid :columns="columns" ref="grid" :action="action"><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">新增</Button>
</template>
</DataGrid>
<Modal v-model="modal" :title="title" width="1200" footer-hide :fullscreen="modalFullscreen">
<component :is="detail" :eid="curId" @on-close="cancel" @on-ok="ok" />
</Modal>
</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/21/2020 11:06:17 AM",
},
data() {
return {
action: Api.index,
easySearch: {
keys:{op:"title",value:null}
},
modal: false,
modalFullscreen:true,
title:"新增",
detail:null,
curId: 0,
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 },
{ key:"title",title:this.l("title") ,align:"left" ,easy:true ,high:true },
{ key:"status",title:this.l("status") ,align:"left" ,high:true ,code:'mes.project_plan.Status' },
{ key:"startDate",title:this.l("startDate") ,align:"left" ,high:true },
{ key:"endDate",title:this.l("endDate") ,align:"left" ,high:true },
{ key:"type",title:this.l("type") ,align:"left" ,high:true ,code:'mes.project_plan.Type' },
{ key:"attachment",title:this.l("attachment") ,align:"left" ,high:true },
{ key:"executor",title:this.l("executor") ,align:"left" ,high:true },
{
title: '操作',
key: 'action',
width: 140,
align: 'center',
render: (h, params) => {
return h('div', { class: "action" }, [
h('op', { attrs: { oprate: 'detail' }, on: { click: () => this.view(params.row.id) } }, '查看'),
h('op', { attrs: { oprate: 'detail' }, on: { click: () => this.main(params.row) } }, '克隆'),
h('op', { attrs: { oprate: 'edit'}, on: { click: () => this.edit(params.row.id) } }, '编辑'),
h('op', { attrs: { oprate: 'delete' }, on: { click: () => this.remove(params.row.id) } }, '删除')
])
}
},
]
}
},
mounted(){
console.log(this);
},
async fetch({ store, params }) {
await store.dispatch('loadDictionary') // 加载数据字典
},
methods:{
ok() {
this.$refs.grid.load()
this.modal = false
this.curId = 0;
},
search() {
this.$refs.grid.reload(this.easySearch)
},
add() {
this.curId = 0;
this.title = "新增";
this.detail =()=> import('./add')
this.modal = true;
},
copy(id) {
this.curId = id;
this.title = "克隆";
this.detail = () =>import('./add')
this.modal = true;
},
main() {
this.title = "模版";
this.detail = () =>import('./main')
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.$refs.grid.load();
this.$Message.success('删除成功')
}
})
},
cancel() {
this.curId = 0;
this.modal = false
},
l(key) {
/*
project_plan:{
creationTime:'创建时间',
creatorUserId:'创建人',
lastModificationTime:'更新时间',
lastModifierUserId:'更新人',
isDeleted:'删除人',
deletionTime:'删除时间',
deleterUserId:'删除人',
projectId:'项目id',
upId:'父级',
title:'标题',
status:'状态',
note:'备注',
startDate:'开始日期',
endDate:'结束日期',
type:'类型',
attachment:'附件',
executor:'执行人',
}
*/
let vkey = "project_plan" + "." + key;
return this.$t(vkey)||key
}
}
}
</script>
<style lang="less">
</style>
\ No newline at end of file
...@@ -53,7 +53,6 @@ export default { ...@@ -53,7 +53,6 @@ export default {
detail: null, detail: null,
curId: this.eid, curId: this.eid,
avatorPath: "", avatorPath: "",
downUrl: fileUrlDown,
entity: {}, entity: {},
rules: { rules: {
name: [{ required: true, message: "必填", trigger: "blur" }], name: [{ required: true, message: "必填", trigger: "blur" }],
...@@ -73,9 +72,7 @@ export default { ...@@ -73,9 +72,7 @@ export default {
if (this.eid) { if (this.eid) {
this.load(this.eid); this.load(this.eid);
} }
// this.detail = () => import("./details"); this.detail = () => import("./details");
// this.parms.eid = this.$u.guid();
// this.parms.eid = r.result.attachment;
}, },
methods: { methods: {
load(v) { load(v) {
......
...@@ -47,7 +47,6 @@ export default { ...@@ -47,7 +47,6 @@ export default {
data() { data() {
return { return {
avatorPath: "", avatorPath: "",
downUrl: fileUrlDown,
entity: this.row, entity: this.row,
parms: { parms: {
app: "material", app: "material",
...@@ -70,6 +69,7 @@ export default { ...@@ -70,6 +69,7 @@ export default {
this.entity = r.result; this.entity = r.result;
this.entity.type = r.result.type + ""; this.entity.type = r.result.type + "";
this.entity.state = r.result.state + ""; this.entity.state = r.result.state + "";
this.avatorPath = r.result.picture;
this.parms.eid = r.result.attachment; this.parms.eid = r.result.attachment;
this.$emit("on-load"); this.$emit("on-load");
}); });
......
...@@ -123,6 +123,15 @@ ...@@ -123,6 +123,15 @@
> >
<component :is="detail" :eid="curId" @on-close="cancel" @on-ok="ok" /> <component :is="detail" :eid="curId" @on-close="cancel" @on-ok="ok" />
</Modal> </Modal>
<Modal
v-model="modal1"
title="查看附件"
width="800"
footer-hide
:mask-closable="false"
>
<FilesView ref="refFile" :parms="parms" class="files-detail" />
</Modal>
</div> </div>
</template> </template>
<script> <script>
...@@ -163,42 +172,42 @@ export default { ...@@ -163,42 +172,42 @@ export default {
high: true, high: true,
}, },
{ // {
key: "lastModificationTime", // key: "lastModificationTime",
title: this.l("lastModificationTime"), // title: this.l("lastModificationTime"),
align: "left", // align: "left",
high: true, // high: true,
hide: true, // hide: true,
}, // },
{ // {
key: "lastModifierUserId", // key: "lastModifierUserId",
title: this.l("lastModifierUserId"), // title: this.l("lastModifierUserId"),
align: "left", // align: "left",
high: true, // high: true,
hide: true, // hide: true,
}, // },
{ // {
key: "isDeleted", // key: "isDeleted",
title: this.l("isDeleted"), // title: this.l("isDeleted"),
align: "left", // align: "left",
high: true, // high: true,
hide: true, // hide: true,
}, // },
{ // {
key: "deletionTime", // key: "deletionTime",
title: this.l("deletionTime"), // title: this.l("deletionTime"),
align: "left", // align: "left",
high: true, // high: true,
hide: true, // hide: true,
}, // },
{ // {
key: "deleterUserId", // key: "deleterUserId",
title: this.l("deleterUserId"), // title: this.l("deleterUserId"),
align: "left", // align: "left",
high: true, // high: true,
hide: true, // hide: true,
}, // },
{ {
key: "title", key: "title",
title: this.l("title"), title: this.l("title"),
...@@ -235,21 +244,21 @@ export default { ...@@ -235,21 +244,21 @@ export default {
); );
}, },
}, },
// { {
// key: "attachment", key: "attachment",
// title: this.l("attachment"), title: this.l("attachment"),
// align: "center", align: "center",
// high: true, high: true,
// render: (h, params) => { render: (h, params) => {
// return h( return h(
// "a", "a",
// { {
// on: { click: () => this.view(params.row.id) }, on: { click: () => this.viewFiles(params.row) },
// }, },
// "查看附件" "查看附件"
// ); );
// }, },
// }, },
// { // {
// key: "phase", // key: "phase",
// title: this.l("phase"), // title: this.l("phase"),
...@@ -285,12 +294,7 @@ export default { ...@@ -285,12 +294,7 @@ export default {
); );
}, },
}, },
// {
// key: "businessUnits",
// title: this.l("businessUnits"),
// align: "left",
// high: true,
// },
{ {
key: "creationTime", key: "creationTime",
title: this.l("creationTime"), title: this.l("creationTime"),
...@@ -304,6 +308,13 @@ export default { ...@@ -304,6 +308,13 @@ export default {
high: true, high: true,
type: "user", type: "user",
}, },
{
key: "note",
title: this.l("note"),
align: "left",
high: true,
tooltip: true,
},
{ {
title: "操作", title: "操作",
key: "action", key: "action",
...@@ -343,10 +354,17 @@ export default { ...@@ -343,10 +354,17 @@ export default {
typeInfo: "table", typeInfo: "table",
iconInfo: "md-list", iconInfo: "md-list",
titleInfo: "列表模式", titleInfo: "列表模式",
parms: {
app: "material",
eid: null,
name: "",
field: "",
},
modal1: false,
}; };
}, },
mounted() { mounted() {
console.log(this); this.parms.eid = this.$u.guid();
}, },
async fetch({ store, params }) { async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典 await store.dispatch("loadDictionary"); // 加载数据字典
...@@ -388,6 +406,12 @@ export default { ...@@ -388,6 +406,12 @@ export default {
console.log(row); console.log(row);
window.open(fileUrlDown + row.picture, "_blank"); window.open(fileUrlDown + row.picture, "_blank");
}, },
viewFiles(row) {
console.log(row);
this.parms.eid = row.attachment;
this.modal1 = true;
},
ok() { ok() {
this.$refs.grid.load(); this.$refs.grid.load();
this.modal = false; this.modal = false;
...@@ -538,4 +562,7 @@ export default { ...@@ -538,4 +562,7 @@ export default {
} }
} }
} }
.files-detail {
min-height: 300px;
}
</style> </style>
\ No newline at end of file
<template>
<!-- <Table :columns="columns" :data="list" /> -->
<div class="hi">
<div class="x">
{{x}}
</div>
<div class="x">
{{y}}
</div>
</div>
</template>
<script>
export default {
name: '',
data() {
return {
x:[],
y:[],
columns:[{
key:"index",
key:"index",
},{
key:"my"
,title:"my"
},
{
key:"ty"
,title:"ty"
},
{
key:"my-ty"
,title:"my-ty"
,render(h,p) {
return h("span",p.row.my-p.row.ty)
},
}
,{
key:"h",
title:"h"
}
],
list:[{"index":9,"ty":410,"my":483,"h":40},{"index":9,"ty":410,"my":480,"h":40},{"index":9,"ty":410,"my":476,"h":40},{"index":9,"ty":410,"my":476,"h":40},{"index":9,"ty":410,"my":474,"h":40},{"index":8,"ty":369,"my":471,"h":40},{"index":8,"ty":369,"my":468,"h":40},{"index":8,"ty":369,"my":466,"h":40},{"index":8,"ty":369,"my":466,"h":40},{"index":8,"ty":369,"my":463,"h":40},{"index":8,"ty":369,"my":460,"h":40},{"index":8,"ty":369,"my":460,"h":40},{"index":8,"ty":369,"my":459,"h":40},{"index":8,"ty":369,"my":456,"h":40},{"index":8,"ty":369,"my":456,"h":40},{"index":8,"ty":369,"my":452,"h":40},{"index":8,"ty":369,"my":452,"h":40},{"index":8,"ty":369,"my":451,"h":40},{"index":8,"ty":369,"my":450,"h":40},{"index":8,"ty":369,"my":450,"h":40},{"index":8,"ty":369,"my":447,"h":40},{"index":8,"ty":369,"my":444,"h":40},{"index":8,"ty":369,"my":444,"h":40},{"index":8,"ty":369,"my":440,"h":40},{"index":8,"ty":369,"my":438,"h":40},{"index":8,"ty":369,"my":438,"h":40},{"index":8,"ty":369,"my":436,"h":40},{"index":8,"ty":369,"my":433,"h":40},{"index":8,"ty":369,"my":433,"h":40},{"index":7,"ty":328,"my":428,"h":40},{"index":7,"ty":328,"my":426,"h":40},{"index":7,"ty":328,"my":426,"h":40},{"index":7,"ty":328,"my":425,"h":40},{"index":7,"ty":328,"my":423,"h":40},{"index":7,"ty":328,"my":423,"h":40},{"index":7,"ty":328,"my":421,"h":40},{"index":7,"ty":328,"my":419,"h":40},{"index":7,"ty":328,"my":419,"h":40},{"index":7,"ty":328,"my":417,"h":40},{"index":7,"ty":328,"my":416,"h":40},{"index":7,"ty":328,"my":416,"h":40},{"index":7,"ty":328,"my":415,"h":40},{"index":7,"ty":328,"my":414,"h":40},{"index":7,"ty":328,"my":414,"h":40},{"index":7,"ty":328,"my":414,"h":40},{"index":7,"ty":328,"my":414,"h":40},{"index":7,"ty":328,"my":413,"h":40},{"index":7,"ty":328,"my":412,"h":40},{"index":7,"ty":328,"my":411,"h":40},{"index":7,"ty":328,"my":411,"h":40},{"index":7,"ty":328,"my":409,"h":40},{"index":7,"ty":328,"my":409,"h":40},{"index":7,"ty":328,"my":408,"h":40},{"index":7,"ty":328,"my":408,"h":40},{"index":7,"ty":328,"my":407,"h":40},{"index":7,"ty":328,"my":406,"h":40},{"index":7,"ty":328,"my":406,"h":40},{"index":7,"ty":328,"my":405,"h":40},{"index":7,"ty":328,"my":404,"h":40},{"index":7,"ty":328,"my":404,"h":40},{"index":7,"ty":328,"my":403,"h":40},{"index":7,"ty":328,"my":402,"h":40},{"index":7,"ty":328,"my":402,"h":40},{"index":7,"ty":328,"my":401,"h":40},{"index":7,"ty":328,"my":399,"h":40},{"index":7,"ty":328,"my":399,"h":40},{"index":7,"ty":328,"my":398,"h":40},{"index":7,"ty":328,"my":395,"h":40},{"index":7,"ty":328,"my":395,"h":40},{"index":7,"ty":328,"my":395,"h":40},{"index":7,"ty":328,"my":394,"h":40},{"index":7,"ty":328,"my":394,"h":40},{"index":7,"ty":328,"my":394,"h":40},{"index":7,"ty":328,"my":394,"h":40},{"index":7,"ty":328,"my":394,"h":40},{"index":7,"ty":328,"my":394,"h":40},{"index":7,"ty":328,"my":392,"h":40},{"index":7,"ty":328,"my":392,"h":40},{"index":7,"ty":328,"my":391,"h":40},{"index":7,"ty":328,"my":390,"h":40},{"index":6,"ty":287,"my":388,"h":40},{"index":6,"ty":287,"my":385,"h":40},{"index":6,"ty":287,"my":382,"h":40},{"index":6,"ty":287,"my":382,"h":40},{"index":6,"ty":287,"my":379,"h":40},{"index":6,"ty":287,"my":376,"h":40},{"index":6,"ty":287,"my":376,"h":40},{"index":6,"ty":287,"my":372,"h":40},{"index":6,"ty":287,"my":370,"h":40},{"index":6,"ty":287,"my":370,"h":40},{"index":6,"ty":287,"my":368,"h":40},{"index":6,"ty":287,"my":366,"h":40},{"index":6,"ty":287,"my":366,"h":40},{"index":6,"ty":287,"my":364,"h":40},{"index":6,"ty":287,"my":364,"h":40},{"index":6,"ty":287,"my":364,"h":40},{"index":6,"ty":287,"my":364,"h":40},{"index":6,"ty":287,"my":364,"h":40},{"index":6,"ty":287,"my":364,"h":40},{"index":6,"ty":287,"my":363,"h":40},{"index":6,"ty":287,"my":362,"h":40},{"index":6,"ty":287,"my":362,"h":40},{"index":6,"ty":287,"my":361,"h":40},{"index":6,"ty":287,"my":360,"h":40},{"index":6,"ty":287,"my":359,"h":40},{"index":6,"ty":287,"my":359,"h":40},{"index":6,"ty":287,"my":358,"h":40},{"index":6,"ty":287,"my":355,"h":40},{"index":6,"ty":287,"my":355,"h":40},{"index":6,"ty":287,"my":353,"h":40},{"index":6,"ty":287,"my":352,"h":40},{"index":6,"ty":287,"my":352,"h":40},{"index":6,"ty":287,"my":351,"h":40},{"index":6,"ty":287,"my":349,"h":40},{"index":6,"ty":287,"my":349,"h":40},{"index":5,"ty":246,"my":345,"h":40},{"index":5,"ty":246,"my":345,"h":40},{"index":5,"ty":246,"my":344,"h":40},{"index":5,"ty":246,"my":343,"h":40},{"index":5,"ty":246,"my":343,"h":40},{"index":5,"ty":246,"my":341,"h":40},{"index":5,"ty":246,"my":340,"h":40},{"index":5,"ty":246,"my":340,"h":40},{"index":5,"ty":246,"my":339,"h":40},{"index":5,"ty":246,"my":337,"h":40},{"index":5,"ty":246,"my":337,"h":40},{"index":5,"ty":246,"my":337,"h":40},{"index":5,"ty":246,"my":336,"h":40},{"index":5,"ty":246,"my":336,"h":40},{"index":5,"ty":246,"my":334,"h":40},{"index":5,"ty":246,"my":332,"h":40},{"index":5,"ty":246,"my":332,"h":40},{"index":5,"ty":246,"my":330,"h":40},{"index":5,"ty":246,"my":330,"h":40},{"index":5,"ty":246,"my":329,"h":40}]
}
}
,mounted(){
this.list.forEach(u=>{
if(this.x.indexOf(u.index)<0){
this.x.push(u.index)
}
if(this.y.indexOf(u.my-u.ty)<0){
this.y.push(u.my-u.ty)
}
})
}
}
</script>
<style lang="" scoped>
</style>
\ No newline at end of file
<template> <template>
<div class="tree"> <div class="tree">
<TreeGrid :columns="columns" :items="treeData"> <TreeGrid :columns="columns" :items="treeData" :drag="true">
<template slot-scope="{row,column,index}" slot="name"> <template slot-scope="{row,column,index}" slot="name">
<Icon type="md-folder" /> {{row.name}} <Icon type="md-folder" /> {{row.name}}
</template> </template>
...@@ -29,6 +29,7 @@ export default { ...@@ -29,6 +29,7 @@ export default {
title: "名称", title: "名称",
tree:true, tree:true,
slot:"name" slot:"name"
}, },
{ {
key: "status", key: "status",
......
...@@ -51,6 +51,8 @@ import NewInputFile from '@/components/page/newInputFile.vue' ...@@ -51,6 +51,8 @@ import NewInputFile from '@/components/page/newInputFile.vue'
import imgUploadFile from '@/components/page/imgUploadFile.vue' import imgUploadFile from '@/components/page/imgUploadFile.vue'
import files from '@/components/page/files.vue' import files from '@/components/page/files.vue'
import FilesList from '@/components/page/filesList.vue' import FilesList from '@/components/page/filesList.vue'
import FilesView from '@/components/page/filesView.vue'
import DataGrid from '@/components/page/dataGrid.vue' import DataGrid from '@/components/page/dataGrid.vue'
import TreeGrid from '@/components/page/treeGrid/index.vue' import TreeGrid from '@/components/page/treeGrid/index.vue'
import Filed from '@/components/page/filed.vue' import Filed from '@/components/page/filed.vue'
...@@ -112,6 +114,7 @@ Vue.component("imgUploadFile", imgUploadFile) ...@@ -112,6 +114,7 @@ Vue.component("imgUploadFile", imgUploadFile)
Vue.component("InputIcon", InputIcon) Vue.component("InputIcon", InputIcon)
Vue.component("files", files) Vue.component("files", files)
Vue.component("FilesList", FilesList) Vue.component("FilesList", FilesList)
Vue.component("FilesView", FilesView)
Vue.component("DataGrid", DataGrid) Vue.component("DataGrid", DataGrid)
Vue.component("TreeGrid", TreeGrid) Vue.component("TreeGrid", TreeGrid)
Vue.component("Filed", Filed) Vue.component("Filed", Filed)
......
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