Commit c600ce61 authored by 康振飞's avatar 康振飞

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

parents 761050ce 4c6d66f4
<template>
<div class="flex fd tree-menu">
<h3 class="stitle pl10">
<h3>
产品结构
<div class="fr mr10 mt10">
<ButtonGroup class="fr" size="small">
......@@ -15,7 +15,7 @@
</div>
</h3>
<div class="search">
<Input search placeholder="关键字" v-model="keys" clearable/>
<Input search placeholder="关键字" v-model="keys" clearable />
</div>
<div class="fg">
<div class="tree">
......@@ -61,46 +61,46 @@ export default {
toggle() {
this.expand = !this.expand;
},
change(v,b) {
let ids=[];
change(v, b) {
let ids = [];
ids.push(b.value);
if(b.children){
if (b.children) {
addId(b.children);
function addId(data){
data.map(u=>{
ids.push(u.value)
if(u.children){
addId(u.children)
function addId(data) {
data.map(u => {
ids.push(u.value);
if (u.children) {
addId(u.children);
}
})
});
}
}
this.$emit("on-select",b.value,b,ids)
this.$emit("on-select", b.value, b, ids);
},
hide(){
this.$emit("on-hide")
hide() {
this.$emit("on-hide");
}
},
computed: {
data() {
let items = this.$u.clone(this.list);
let expand = this.expand;
let result=[];
search(this.keys,items)
function search(keys,data){
data.map(u=>{
if(keys.length<3){
u.expand=expand;
let result = [];
search(this.keys, items);
function search(keys, data) {
data.map(u => {
if (keys.length < 3) {
u.expand = expand;
result.push(u);
}else{
u.expand=expand;
if(u.title.indexOf(keys)>-1){
} else {
u.expand = expand;
if (u.title.indexOf(keys) > -1) {
result.push(u);
}else if(u.children){
search(keys,u.children)
} else if (u.children) {
search(keys, u.children);
}
}
})
});
}
return result;
}
......@@ -110,6 +110,17 @@ export default {
<style lang="less">
.tree-menu {
h3 {
height: 50px;
font-size: 14px;
font-family: Microsoft YaHei;
font-weight: bold;
line-height: 50px;
color: rgba(81, 90, 110, 1);
background:rgba(245,246,250,1);
opacity: 1;
padding-left: 10px;
}
.search {
height: 50px;
padding: 5px 10px;
......
<template>
<div class="i-quill" :class="classes">
<div class="i-quill" :class="classes" >
<div ref="editor" :style="styles"></div>
</div>
</template>
<script>
import Quill from 'quill';
import 'quill/dist/quill.core.css';
import 'quill/dist/quill.snow.css';
import 'quill/dist/quill.bubble.css';
export default {
name: 'i-quill',
import Quill from "quill";
import "quill/dist/quill.core.css";
import "quill/dist/quill.snow.css";
import "quill/dist/quill.bubble.css";
// import resizeImage from "quill-image-resize-module"; // 图片缩放组件。
// import { ImageDrop } from "quill-image-drop-module"; // 图片拖动组件。
// Quill.register("modules/imageDrop", ImageDrop);
// Quill.register("modules/resizeImage ", resizeImage);
export default {
name: "i-quill",
props: {
value: {
type: String,
default: ''
default: ""
},
border: {
type: Boolean,
......@@ -28,45 +31,54 @@
type: Number
}
},
data () {
data() {
return {
Quill: null,
currentValue: '',
currentValue: "",
options: {
theme: 'snow',
theme: "snow",
bounds: document.body,
debug: 'warn',
debug: "warn",
modules: {
// imageDrop: true,
// imageResize: {
// displayStyles: {
// backgroundColor: "black",
// border: "none",
// color: "white"
// },
// modules: ["Resize", "DisplaySize", "Toolbar"]
// },
toolbar: [
['bold', 'italic', 'underline', 'strike'],
[{ 'header': [1, 2, 3, 4, 5, 6, false] }],
[{ 'size': ['small', false, 'large', 'huge'] }],
[{ 'color': [] }, { 'background': [] }],
['blockquote', 'code-block'],
[{ 'list': 'ordered' }, { 'list': 'bullet' }],
["bold", "italic", "underline", "strike"],
[{ header: [1, 2, 3, 4, 5, 6, false] }],
[{ size: ["small", false, "large", "huge"] }],
[{ color: [] }, { background: [] }],
["blockquote", "code-block"],
[{ list: "ordered" }, { list: "bullet" }],
// [{ 'script': 'sub' }, { 'script': 'super' }],
[{ 'indent': '-1' }, { 'indent': '+1' }],
[{ 'align': [] }],
[{ 'direction': 'rtl' }],
[{ indent: "-1" }, { indent: "+1" }],
[{ align: [] }],
[{ direction: "rtl" }],
// [{ 'font': [] }],
['clean'],
['link', 'image']
["clean"],
["link", "image"]
]
},
placeholder: '内容...',
placeholder: "内容...",
readOnly: false
}
}
};
},
computed: {
classes () {
classes() {
return [
{
'i-quill-no-border': !this.border
"i-quill-no-border": !this.border
}
];
},
styles () {
styles() {
let style = {};
if (this.minHeight) {
style.minHeight = `${this.minHeight}px`;
......@@ -79,7 +91,7 @@
},
watch: {
value: {
handler (val) {
handler(val) {
if (val !== this.currentValue) {
this.currentValue = val;
if (this.Quill) {
......@@ -91,53 +103,74 @@
}
},
methods: {
init () {
init() {
const editor = this.$refs.editor;
// 初始化编辑器
this.Quill = new Quill(editor, this.options);
// 默认值
this.Quill.pasteHTML(this.currentValue);
// 绑定事件
this.Quill.on('text-change', (delta, oldDelta, source) => {
this.Quill.on("text-change", (delta, oldDelta, source) => {
const html = this.$refs.editor.children[0].innerHTML;
const text = this.Quill.getText();
const quill = this.Quill;
// 更新内部的值
this.currentValue = html;
// 发出事件 v-model
this.$emit('input', html);
this.$emit("input", html);
// 发出事件
this.$emit('on-change', { html, text, quill });
this.$emit("on-change", { html, text, quill });
});
// 将一些 quill 自带的事件传递出去
this.Quill.on('text-change', (delta, oldDelta, source) => {
this.$emit('on-text-change', delta, oldDelta, source);
this.Quill.on("text-change", (delta, oldDelta, source) => {
this.$emit("on-text-change", delta, oldDelta, source);
});
this.Quill.on('selection-change', (range, oldRange, source) => {
this.$emit('on-selection-change', range, oldRange, source);
this.Quill.on("selection-change", (range, oldRange, source) => {
this.$emit("on-selection-change", range, oldRange, source);
});
this.Quill.on('editor-change', (eventName, ...args) => {
this.$emit('on-editor-change', eventName, ...args);
this.Quill.on("editor-change", (eventName, ...args) => {
this.$emit("on-editor-change", eventName, ...args);
});
}
},
mounted () {
handleImg(e) {
console.warn(e);
let file = null;
if (
e.clipboardData &&
e.clipboardData.items[0] &&
e.clipboardData.items[0].type &&
e.clipboardData.items[0].type.indexOf("image") > -1
) {
//这里就是判断是否有粘贴进来的文件且文件为图片格式
file = e.clipboardData.items[0].getAsFile();
let reader = new FileReader();
reader.readAsDataURL(file);
setTimeout(() => {
var img = '<img src="' + reader.result + '" alt=""/>';
this.currentValue += img;
}, 1000);
// new R
}
},
mounted() {
this.init();
},
beforeDestroy () {
beforeDestroy() {
// 在组件销毁后销毁实例
this.Quill = null;
}
}
};
</script>
<style lang="less">
.i-quill-no-border{
.ql-toolbar.ql-snow{
.i-quill-no-border {
.ql-toolbar.ql-snow {
border: none;
border-bottom: 1px solid #e8eaec;
}
.ql-container.ql-snow{
.ql-container.ql-snow {
border: none;
}
}
}
</style>
......@@ -1180,7 +1180,7 @@ export default {
routingType: '工艺类型',
status: '状态',
approvalStatus: '审批状态',
remark: '备注',
remark: '工艺说明',
approvalStatusRemark: '审批备注',
auditUserId1: '审批人',
auditUserId2: '审批人',
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -12,19 +12,23 @@
},
"dependencies": {
"@nuxtjs/axios": "^5.3.6",
"@svgdotjs/svg.draggable.js": "^3.0.2",
"@svgdotjs/svg.js": "^3.0.16",
"area-data": "^5.0.6",
"awe-dnd": "^0.3.4",
"better-scroll": "^1.12.1",
"cross-env": "^5.2.0",
"dayjs": "^1.8.22",
"echarts": "^4.7.0",
"echarts-liquidfill": "^2.0.5",
"gojs": "^2.1.10",
"iview-loader": "^1.3.0",
"iview-pro": "file:./iview-pro",
"js-cookie": "^2.2.1",
"less": "^3.10.3",
"less-loader": "^5.0.0",
"lodash.chunk": "^4.2.0",
"lodash": "^4.17.15",
"lodash.chunk": "^4.2.0",
"lowdb": "^1.0.0",
"marked": "^0.3.9",
"mockjs": "^1.0.1-beta3",
......@@ -32,12 +36,9 @@
"nuxt": "^2.10.2",
"oidc-client": "^1.9.1",
"qs": "^6.6.0",
"gojs": "^2.1.10",
"quill-image-drop-module": "^1.0.3",
"quill-image-resize-module": "^3.0.0",
"screenfull": "^5.0.2",
"area-data": "^5.0.6",
"xlsx": "^0.15.1",
"@svgdotjs/svg.draggable.js": "^3.0.2",
"@svgdotjs/svg.js": "^3.0.16",
"ua-parser-js": "^0.7.18",
"view-design": "^4.1.3",
"vue-echarts": "^4.0.3",
......@@ -47,7 +48,8 @@
"vue-ueditor-wrap": "^2.4.1",
"vue2-editor": "^2.10.2",
"vuedraggable": "^2.23.0",
"vuex-along": "^1.2.10"
"vuex-along": "^1.2.10",
"xlsx": "^0.15.1"
},
"devDependencies": {
"@babel/plugin-transform-runtime": "^7.2.0",
......
<template>
<div class="compare">
<div class="btn">
<div class="btn" style="z-index:9999;position:absolute;right:0">
<Button type="primary" @click="parameter">下发</Button>
<!-- <Button type="primary">导出</Button>000 -->
<Button type="primary" icon="ios-redo" @click="comeBlck">返回</Button>
......
......@@ -3,7 +3,7 @@
</style>
<template>
<div>
<div class="btn">
<div class="btn" style="z-index:9999;position:absolute;right:0">
<Button type="primary" @click="parameter">下发</Button>
<!-- <Button type="primary">导出</Button>000 -->
<Button type="primary" icon="ios-redo" @click="comeBlck">返回</Button>
......
......@@ -33,7 +33,6 @@
<i-quill
v-model="bugForm.content"
:height="600"
v-paste="handleImg"
/>
</FormItem>
</Row>
......
......@@ -11,52 +11,52 @@
<Input v-model="entity.unicode"></Input>
</FormItem>
</Col>-->
<Col :span="12">
<Col :span="8">
<FormItem :label="l('name')" prop="name">
<Input v-model="entity.name"></Input>
</FormItem>
</Col>
<Col :span="12">
<Col :span="8">
<FormItem :label="l('code')" prop="code">
<Input v-model="entity.code"></Input>
</FormItem>
</Col>
<Col :span="12">
<Col :span="8">
<FormItem :label="l('routingType')" prop="routingType">
<Dictionary code="Process.Routing.routingType" v-model="entity.routingType"></Dictionary>
</FormItem>
</Col>
<Col :span="12">
<Col :span="8">
<FormItem :label="l('productId')" prop="productId">
<ProductSelect v-model="entity.productId"></ProductSelect>
</FormItem>
</Col>
<Col :span="12">
<Col :span="8">
<FormItem :label="l('version')" prop="version">
<Input v-model="entity.version"></Input>
</FormItem>
</Col>
<Col :span="12">
<Col :span="8">
<FormItem :label="l('author')" prop="author">
<UserSelect v-model="entity.author"></UserSelect>
</FormItem>
</Col>
<Col :span="12">
<Col :span="8">
<FormItem :label="l('departmentId')" prop="departmentId">
<departmentSelect v-model="entity.departmentId"></departmentSelect>
</FormItem>
</Col> <Col :span="12">
</Col> <Col :span="5">
<FormItem :label="l('isMain')" prop="isMain">
<Dictionary code="Process.state" v-model="entity.isMain" type="radio"></Dictionary>
</FormItem>
</Col>
<Col :span="12">
<Col :span="6">
<FormItem :label="l('isSendPpm')" prop="isSendPpm">
<Dictionary code="Process.Status" v-model="entity.isSendPpm" type="radio"></Dictionary>
</FormItem>
</Col>
<Col :span="12">
<Col :span="5">
<FormItem :label="l('isEffect')" prop="isEffect">
<Dictionary code="Process.Status" v-model="entity.isEffect" type="radio"></Dictionary>
</FormItem>
......@@ -120,12 +120,24 @@
<InputNumber v-model="entity.versionid"></InputNumber>
</FormItem>
</Col>-->
<Col :span="24">
<FormItem :label="l('remark')" prop="remark">
<Input v-model="entity.remark" type="textarea" :rows="5"></Input>
<i-quill
v-model="entity.remark"
:height="300"
border
v-paste="handleImg"
/>
</FormItem>
</Col>
<Col :span="24">
<FormItem label="多媒体附件" prop="files">
<files />
</FormItem>
</Col>
</Row>
<FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button>
......@@ -135,8 +147,13 @@
</template>
<script>
import Api from "./api";
import iQuill from '@/components/quill'
export default {
name: "Add",
components: {
iQuill
// VueUeditorWrap
},
data() {
return {
disabled: false,
......@@ -206,6 +223,27 @@ export default {
},
handleClose() {
this.$emit("on-close");
},
handleImg(e) {
console.warn(e)
let file = null
if (
e.clipboardData &&
e.clipboardData.items[0] &&
e.clipboardData.items[0].type &&
e.clipboardData.items[0].type.indexOf('image') > -1
) {
//这里就是判断是否有粘贴进来的文件且文件为图片格式
file = e.clipboardData.items[0].getAsFile()
let reader = new FileReader()
reader.readAsDataURL(file)
setTimeout(() => {
var img = '<img src="' + reader.result + '" alt=""/>'
this.entity.remark += img
}, 1000)
// new R
}
},
load(v) {
Api.get({ id: v }).then(r => {
......
......@@ -53,7 +53,7 @@ export default {
key: "stepSeq",
title: this.l("stepSeq"),
align: "left",
width: 150,
width: 100,
render: (h, params) => {
return h("div", { style: "padding-left:10px" }, params.row.stepSeq);
}
......@@ -88,7 +88,7 @@ export default {
{
key: "creationTime",
title: this.l("creationTime"),
align: "left",
align: "center",
width: 200
},
{
......
<template>
<div>
<DataGrid :columns="columns" ref="grid" :data="list" :easy="false" :high="false">
<DataGrid :columns="columns" ref="grid" :data="list" :easy="false" :high="false" :page="false">
<template slot="buttons">
<Button type="primary" @click="add">新增</Button>
</template>
......
......@@ -14,12 +14,12 @@
<Col :span="12">
<FormItem :label="l('stepSeq')" prop="stepSeq">
<!-- <InputNumber v-model="entity.stepSeq"></InputNumber> -->
<Input style="width:300px" v-model="entity.stepSeq"></Input>
<InputNumber v-model="entity.stepSeq"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('name')" prop="name">
<Input style="width:350px" v-model="entity.name"></Input>
<Input v-model="entity.name"></Input>
</FormItem>
</Col>
<Col :span="24">
......
......@@ -4,12 +4,12 @@
<Col :span="12">
<FormItem :label="l('stepSeq')" prop="stepSeq">
<!-- <InputNumber v-model="entity.stepSeq"></InputNumber> -->
<Input style="width:300px" v-model="entity.stepSeq"></Input>
<InputNumber v-model="entity.stepSeq"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('name')" prop="name">
<Input style="width:350px" v-model="entity.name"></Input>
<Input v-model="entity.name"></Input>
</FormItem>
</Col>
<Col :span="24">
......
......@@ -11,52 +11,53 @@
<Input v-model="entity.unicode"></Input>
</FormItem>
</Col>-->
<Col :span="12">
<Col :span="8">
<FormItem :label="l('name')" prop="name">
<Input v-model="entity.name"></Input>
</FormItem>
</Col>
<Col :span="12">
<Col :span="8">
<FormItem :label="l('code')" prop="code">
<Input v-model="entity.code"></Input>
</FormItem>
</Col>
<Col :span="12">
<Col :span="8">
<FormItem :label="l('routingType')" prop="routingType">
<Dictionary code="Process.Routing.routingType" v-model="entity.routingType"></Dictionary>
</FormItem>
</Col>
<Col :span="12">
<Col :span="8">
<FormItem :label="l('productId')" prop="productId">
<ProductSelect v-model="entity.productId"></ProductSelect>
</FormItem>
</Col>
<Col :span="12">
<Col :span="8">
<FormItem :label="l('version')" prop="version">
<Input v-model="entity.version"></Input>
</FormItem>
</Col>
<Col :span="12">
<Col :span="8">
<FormItem :label="l('author')" prop="author">
<UserSelect v-model="entity.author"></UserSelect>
</FormItem>
</Col>
<Col :span="12">
<Col :span="8">
<FormItem :label="l('departmentId')" prop="departmentId">
<departmentSelect v-model="entity.departmentId"></departmentSelect>
</FormItem>
</Col> <Col :span="12">
</Col>
<Col :span="5">
<FormItem :label="l('isMain')" prop="isMain">
<Dictionary code="Process.state" v-model="entity.isMain" type="radio"></Dictionary>
</FormItem>
</Col>
<Col :span="12">
<Col :span="6">
<FormItem :label="l('isSendPpm')" prop="isSendPpm">
<Dictionary code="Process.Status" v-model="entity.isSendPpm" type="radio"></Dictionary>
</FormItem>
</Col>
<Col :span="12">
<Col :span="5">
<FormItem :label="l('isEffect')" prop="isEffect">
<Dictionary code="Process.Status" v-model="entity.isEffect" type="radio"></Dictionary>
</FormItem>
......@@ -120,10 +121,15 @@
<InputNumber v-model="entity.versionid"></InputNumber>
</FormItem>
</Col>-->
<Col :span="24">
<FormItem :label="l('remark')" prop="remark">
<Input v-model="entity.remark" type="textarea" :rows="5"></Input>
<i-quill v-model="entity.remark" :height="300" border v-paste="handleImg" />
</FormItem>
</Col>
<Col :span="24">
<FormItem label="多媒体附件" prop="files">
<files />
</FormItem>
</Col>
</Row>
......@@ -135,7 +141,12 @@
</template>
<script>
import Api from "./api";
import iQuill from "@/components/quill";
export default {
components: {
iQuill
// VueUeditorWrap
},
name: "Edit",
data() {
return {
......@@ -182,6 +193,27 @@ export default {
}
});
},
handleImg(e) {
console.warn(e);
let file = null;
if (
e.clipboardData &&
e.clipboardData.items[0] &&
e.clipboardData.items[0].type &&
e.clipboardData.items[0].type.indexOf("image") > -1
) {
//这里就是判断是否有粘贴进来的文件且文件为图片格式
file = e.clipboardData.items[0].getAsFile();
let reader = new FileReader();
reader.readAsDataURL(file);
setTimeout(() => {
var img = '<img src="' + reader.result + '" alt=""/>';
this.entity.remark += img;
}, 1000);
// new R
}
},
handleClose() {
this.$emit("on-close");
},
......
......@@ -6,6 +6,7 @@
.con {
padding: 5px 5px 0px 10px;
}
background: rgba(245,246,250,1);
}
.fullWindow {
position: fixed;
......@@ -37,10 +38,6 @@
</a>
</div>
<Content class="con">
<!-- <a class="detail_href" @click="view">
<Icon type="ios-undo-outline" />详情页面
</a>-->
<Card class="h100">
<DataGrid :columns="columns" ref="grid" :action="action" class="card_box">
<template slot="easySearch">
<Form ref="formInline" :model="easySearch" inline>
......@@ -64,7 +61,6 @@
<Button type="primary" @click="add">新增</Button>
</template>
</DataGrid>
</Card>
<Modal v-model="modal" :title="title" width="1200" footer-hide>
<component :is="detail" :eid="curId" @on-close="cancel" @on-ok="ok" />
</Modal>
......
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