提交 4cec5577 编写于 作者: zhentian.jia's avatar zhentian.jia

拖拽组件添加

上级 12faf853
......@@ -7945,6 +7945,11 @@
"is-plain-obj": "^1.0.0"
}
},
"sortablejs": {
"version": "1.10.0-rc3",
"resolved": "http://192.168.110.93:4873/sortablejs/-/sortablejs-1.10.0-rc3.tgz",
"integrity": "sha1-L+Y0Y6OLXNEuyRT8PgNYMEhJb0I="
},
"source-list-map": {
"version": "0.1.8",
"resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-0.1.8.tgz",
......
......@@ -10,9 +10,9 @@ export const envConfig = {
// baseUrl: 'https://uat-sc.yunqueyi.com/',
// baseUrl: 'http://10.177.15.150:10401/',
// baseUrl: 'http://10.177.15.150:11905/',
// baseUrl: 'https://dev-sc.yunqueyi.com/',
baseUrl: 'https://dev-sc.yunqueyi.com/',
// baseUrl: 'https://test1-sc.yunqueyi.com/',
baseUrl: 'https://uat-sc.yunqueyi.com/',
// baseUrl: 'https://uat-sc.yunqueyi.com/',
apiUrl: 'https://dev-api.yunqueyi.com/',
qiniuFileUrl: "https://dev-sc.yunqueyi.com/contents/admin/qiniu/token1",
qiniuResourceUrl: "https://test1-videos.yunqueyi.com",
......
......@@ -54,7 +54,7 @@ service.interceptors.request.use(config => {
}
if( process.env.BUILD_ENV == "development" ){ // 本地开发环境
// console.log('环境变量>>>> ', process.env.BUILD_ENV);
config.headers['token'] = '6F0F3B3F0EB24A14AA025FA47CD43770';
config.headers['token'] = '75E66BEF653E4DFB9F54209901EA76AD';
}else{
config.headers['token'] = localStorage.getItem('storageToken')
}
......
......@@ -36,9 +36,32 @@
style="width:83%;"
:disabled="peopleLevel == 'L3'"
></el-input>
<span class="word-num">{{(formData.projectName).replace(/\s+/g,"").length}}/20</span>
<span class="word-num">{{(formData.projectName).replace(/\s+/g,"").length}}/24</span>
</el-col>
</el-form-item>
<el-form-item label="发起机构名称:" prop="organizationName">
<el-col :span="13">
<el-input
size="small"
v-model="formData.organizationName"
placeholder="请输入发起机构名称"
style="width:83%;"
:disabled="peopleLevel == 'L3'"
@input="changeOrganizationName"
@blur = "blurName"
@focus = "focusName"
></el-input>
<span class="word-num">{{(formData.organizationName).replace(/\s+/g,"").length}}/12</span>
</el-col>
<el-popover
class="popover-content"
placement="bottom"
:content="organizationContent"
v-model="visibleName"
@click="checkDefault">
<p @click="checkDefault"> 我的机构: {{ organizationContent }} </p>
</el-popover>
</el-form-item>
<el-form-item label="项目时间:" required>
<el-col :span="5">
<el-form-item prop="projectBegintime">
......@@ -82,7 +105,7 @@
style="width:83%;"
:disabled="peopleLevel == 'L3'"
></el-input>
<span class="word-num">{{(formData.projectIntro).replace(/\s+/g,"").length}}/150</span>
<span class="word-num">{{(formData.projectIntro).replace(/\s+/g,"").length}}/200</span>
</el-col>
</el-form-item>
<div class="basic-item-icon">
......@@ -180,6 +203,26 @@
<el-radio :label="1">使用小生态范围</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="项目上线通知">
<el-radio-group
size="small"
v-model="formData.sendOption"
:disabled="peopleLevel == 'L3'"
>
<el-radio :label="1">通知</el-radio>
<el-radio :label="2">不通知</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="通知范围">
<el-radio-group
size="small"
v-model="formData.receiveOption"
:disabled="peopleLevel == 'L3'"
>
<el-radio :label="1">次级负责人</el-radio>
<el-radio :label="2">所有人</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="添加下载文件:">
<el-col :span="10">
<el-upload
......@@ -544,6 +587,7 @@
<div class="third-step" v-else-if="active === 2">
<el-form
ref="formComponent"
class="form-component"
label-width="150px"
:model="formComponent"
:rules="rulesComponent"
......@@ -568,11 +612,12 @@
</el-select>
</el-col>
</el-form-item>
<el-form-item label="已选择:">
<el-form-item label="已选择:" class="check-component">
<el-col :span="20">
<el-tag
class = "tags-component"
v-for="tag in tagsComponent"
:key="tag.name"
:key="tag.value"
closable
:type="tag.type"
style="margin-left: 10px;"
......@@ -691,28 +736,15 @@ import { mapGetters } from "vuex";
import { openLoading, closeLoading } from "../../utils/utils";
import * as commonUtil from "../../utils/utils";
import * as operationData from "../../utils/operation";
import Sortable from 'sortablejs'
let vm = null;
export default {
components: {
BreadCrumb
},
data() {
// const itemOrganization = {
// name: "上海市第一人民医院",
// grade: "二甲医院",
// province: "上海市",
// city: "上海市",
// district: "浦东新区",
// street: "张江街道"
// };
// const itemPerson = {
// name: "云小鹊",
// hospital: "上海市第一人民医院",
// department: "全科",
// province: "上海市",
// city: "上海市",
// district: "长宁区"
// };
let checkProjectStr = (rule, value, callback) => {
if(value.indexOf("\\") != -1) {//存在
callback(new Error('请勿输入字符“ \\ ”'));
......@@ -725,8 +757,7 @@ export default {
return {
idTypeValue: 1,
idTypeProject: '',
// itemOrganization: itemOrganization,
// itemPerson: itemPerson,
projectId: null,
peopleLevel: null,
//面包屑
......@@ -734,7 +765,7 @@ export default {
curmbSecond: "新建项目",
//页面展示位置
stepData: [true, false, false],
active: 0,
active: 2,
activeName: "first",
//基层信息 数据
uploadImgMessage: false,
......@@ -754,6 +785,9 @@ export default {
attachmentMore1: {},
attachmentMore2: {},
scopeType: 0,
organizationName: '',
sendOption: 1,
receiveOption: 1,
},
pickerOptions0: {
disabledDate: time => {
......@@ -908,6 +942,8 @@ export default {
value: 1,
}
],
visibleName: false,
organizationContent: '',
//校验工具 数据
rulesComponent: {
component: [
......@@ -922,12 +958,16 @@ export default {
{ required: true, message: "请输入项目名称", trigger: "blur" },
{
min: 2,
max: 20,
max: 24,
message: "输入长度为2-20的内容,可包含中英文、数字及特殊符号",
trigger: "blur"
},
{ validator: checkProjectStr, trigger: 'blur' }
],
organizationName: [
{ required: true, message: "请填写发起机构名称", trigger: "blur" },
{ min: 1, max: 12, message: "超出可输入的最大长度", trigger: "blur" }
],
duringTime: [
{
required: true,
......@@ -962,7 +1002,7 @@ export default {
],
projectIntro: [
{ required: true, message: "请填写项目简介", trigger: "blur" },
{ min: 1, max: 150, message: "超出可输入的最大长度", trigger: "blur" }
{ min: 1, max: 200, message: "超出可输入的最大长度", trigger: "blur" }
],
attachmentUrl1: [
{ required: true, message: "请选择列表图片", trigger: "blur" }
......@@ -1057,7 +1097,12 @@ export default {
attachmentSize: editData.attachmentData[1].attachmentSize
},
scopeType: editData.projectData.scopeType,
organizationName: editData.projectData.organizationName,
notifyId: editData.notifyData.notifyId,
sendOption: editData.notifyData.sendOption,
receiveOption: editData.notifyData.receiveOption,
};
this.organizationContent = editData.projectData.creatorOrganizationName;
if (editData.attachmentData.length > 2) {
for (let i = 2; i < editData.attachmentData.length; i++) {
let pdfItem = {
......@@ -1136,6 +1181,7 @@ export default {
projectEndtime: this.formData.projectEndtime,
projectIntro: this.formData.projectIntro,
scopeType: this.formData.scopeType,
organizationName: this.formData.organizationName,
};
let attachmentModel = [
{
......@@ -1183,10 +1229,20 @@ export default {
}
//idTypeProject
}
//教培项目v2.1.0新增通知优化
let notifyData = {
notifyId: 0,
receiveOption: this.formData.receiveOption,
sendOption: this.formData.sendOption,
};
if(option == "edit" || option == "storageEdit") {
notifyData.notifyId = this.formData.notifyId;
}
let postData = {
projectModel: JSON.stringify(projectModel),
attachmentModel: JSON.stringify(attachmentModel),
attachmentPDFModel: JSON.stringify(attachmentPDFModel)
attachmentPDFModel: JSON.stringify(attachmentPDFModel),
notifyData: JSON.stringify(notifyData),
};
//console.log(postData);
openLoading(vm);
......@@ -3074,6 +3130,9 @@ export default {
}
}
//console.log('this.tagsComponent',this.tagsComponent);
if(vm.tagsComponent.length > 0) {
vm.tagDrop();
}
},
initTags(value) {
//console.log('value',value,'optionsComponent',this.optionsComponent);
......@@ -3090,6 +3149,9 @@ export default {
}
}
//console.log('this.tagsComponent',this.tagsComponent);
if(vm.tagsComponent.length > 0) {
vm.tagDrop();
}
},
//选择组件数据绑定
handleCloseComponent(tag) {
......@@ -3276,7 +3338,43 @@ export default {
}
}
return true;
}
},
blurName() {
vm.visibleName = false;
},
focusName() {
let textLength = vm.formData.organizationName.length;
if(textLength == 0) {
vm.visibleName = true;
} else {
vm.visibleName = false;
}
},
changeOrganizationName() {
let textLength = vm.formData.organizationName.length;
console.log('文字长度',textLength);
if(textLength == 0) {
vm.visibleName = true;
} else {
vm.visibleName = false;
}
},
checkDefault() {
console.log('点击checkDefault')
vm.formData.organizationName = vm.organizationContent;
vm.visibleName = false;
},
tagDrop() {
const ele = document.querySelector('.el-form-item__content .el-col-20')
console.log('ele',ele);
const _this = this
Sortable.create(ele, {
onEnd({ newIndex, oldIndex }) {
const currRow = vm.tagsComponent.splice(oldIndex, 1)[0]
vm.tagsComponent.splice(newIndex, 0, currRow)
}
})
},
}
};
</script>
......@@ -3418,6 +3516,10 @@ export default {
color: #409eff;
border: 1px solid #409eff;
}
.el-popover--plain {
padding: 18px 20px;
top: 40px;
}
}
.second-step {
margin: 10px 0 0 20px;
......@@ -3496,6 +3598,18 @@ export default {
.achievement {
margin-top: 60px;
}
.form-component {
position: relative;
}
.check-component {
top: 0px;
left: 550px;
position: absolute;
}
.el-tag {
margin-top: 5px;
display: table;
}
}
}
</style>
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册