修复周三测试提出的住数据bug
This commit is contained in:
parent
aee09418c5
commit
aecb96adcd
|
@ -195,7 +195,7 @@
|
||||||
class="showText"
|
class="showText"
|
||||||
@click="elDialogClick(row, index, indexRow)"
|
@click="elDialogClick(row, index, indexRow)"
|
||||||
>
|
>
|
||||||
{{ ruleForm[row.prop] ? ruleForm[row.prop] : "请点击选择" }}
|
{{ ruleForm[row.prop] ? ruleForm[row.prop] : '请点击选择' }}
|
||||||
<!-- <el-input v-model="ruleForm[row.prop]"></el-input> -->
|
<!-- <el-input v-model="ruleForm[row.prop]"></el-input> -->
|
||||||
</p>
|
</p>
|
||||||
<!-- <i class="el-icon-more " v-if="row.elDialogHoverType"></i> -->
|
<!-- <i class="el-icon-more " v-if="row.elDialogHoverType"></i> -->
|
||||||
|
@ -321,11 +321,11 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import baseCascader from "./baseCascader/index.vue";
|
import baseCascader from './baseCascader/index.vue'
|
||||||
import {deepClone} from "@/utils/index.js";
|
import { deepClone } from '@/utils/index.js'
|
||||||
import baseDatePicker from "./baseDatePicker.vue";
|
import baseDatePicker from './baseDatePicker.vue'
|
||||||
import baseNewSelect from "./baseNewSelect";
|
import baseNewSelect from './baseNewSelect'
|
||||||
import {checkMobile} from "@/utils/util";
|
import { checkMobile } from '@/utils/util'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
|
@ -333,88 +333,88 @@ export default {
|
||||||
// customCascader
|
// customCascader
|
||||||
baseNewSelect,
|
baseNewSelect,
|
||||||
baseDatePicker,
|
baseDatePicker,
|
||||||
baseCascader,
|
baseCascader
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
// 提交按钮loading
|
// 提交按钮loading
|
||||||
loading: {
|
loading: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: false
|
||||||
},
|
},
|
||||||
// 是否校验正则(搜索模式)
|
// 是否校验正则(搜索模式)
|
||||||
formRule: {
|
formRule: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: true,
|
default: true
|
||||||
},
|
},
|
||||||
refName: {
|
refName: {
|
||||||
type: String,
|
type: String,
|
||||||
default: "ruleForm",
|
default: 'ruleForm'
|
||||||
},
|
},
|
||||||
// 表单新建模式
|
// 表单新建模式
|
||||||
newFlag: {
|
newFlag: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: false
|
||||||
},
|
},
|
||||||
// 表单查看模式
|
// 表单查看模式
|
||||||
lookFlag: {
|
lookFlag: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: false
|
||||||
},
|
},
|
||||||
// 表单显示格式
|
// 表单显示格式
|
||||||
spanNumber: {
|
spanNumber: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 12,
|
default: 12
|
||||||
},
|
},
|
||||||
spanWidth: {
|
spanWidth: {
|
||||||
type: String,
|
type: String,
|
||||||
default: "120px",
|
default: '120px'
|
||||||
},
|
},
|
||||||
// 表单验证规则
|
// 表单验证规则
|
||||||
rules: {
|
rules: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: () => {
|
default: () => {
|
||||||
return {};
|
return {}
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
// 表单页面结构数据
|
// 表单页面结构数据
|
||||||
formRow: {
|
formRow: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: () => {
|
default: () => {
|
||||||
return [];
|
return []
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
// 是否禁用
|
// 是否禁用
|
||||||
disabled: {
|
disabled: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: false
|
||||||
},
|
},
|
||||||
// 是否显示操作按钮
|
// 是否显示操作按钮
|
||||||
isFunBtn: {
|
isFunBtn: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: true,
|
default: true
|
||||||
},
|
},
|
||||||
formdata: {
|
formdata: {
|
||||||
type: Object,
|
type: Object
|
||||||
},
|
},
|
||||||
justifyContent: {
|
justifyContent: {
|
||||||
type: String,
|
type: String,
|
||||||
default: "flex-end",
|
default: 'flex-end'
|
||||||
},
|
},
|
||||||
marginBottom: {
|
marginBottom: {
|
||||||
type: String,
|
type: String,
|
||||||
default: "0",
|
default: '0'
|
||||||
},
|
},
|
||||||
ruleForm: {
|
ruleForm: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: () => {
|
default: () => {
|
||||||
return {};
|
return {}
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
tableColumn: {
|
tableColumn: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: () => {
|
default: () => {
|
||||||
return [];
|
return []
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
treeSelectInfo: {
|
treeSelectInfo: {
|
||||||
type: Object,
|
type: Object,
|
||||||
|
@ -428,76 +428,76 @@ export default {
|
||||||
pickerOptionsSearch: {
|
pickerOptionsSearch: {
|
||||||
shortcuts: [
|
shortcuts: [
|
||||||
{
|
{
|
||||||
text: "本月",
|
text: '本月',
|
||||||
onClick(picker) {
|
onClick(picker) {
|
||||||
picker.$emit("pick", [new Date(), new Date()]);
|
picker.$emit('pick', [new Date(), new Date()])
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: "今年至今",
|
text: '今年至今',
|
||||||
onClick(picker) {
|
onClick(picker) {
|
||||||
const end = new Date();
|
const end = new Date()
|
||||||
const start = new Date(new Date().getFullYear(), 0);
|
const start = new Date(new Date().getFullYear(), 0)
|
||||||
picker.$emit("pick", [start, end]);
|
picker.$emit('pick', [start, end])
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: "最近六个月",
|
text: '最近六个月',
|
||||||
onClick(picker) {
|
onClick(picker) {
|
||||||
const end = new Date();
|
const end = new Date()
|
||||||
const start = new Date();
|
const start = new Date()
|
||||||
start.setMonth(start.getMonth() - 6);
|
start.setMonth(start.getMonth() - 6)
|
||||||
picker.$emit("pick", [start, end]);
|
picker.$emit('pick', [start, end])
|
||||||
},
|
}
|
||||||
},
|
}
|
||||||
],
|
]
|
||||||
},
|
},
|
||||||
// 表单数据
|
// 表单数据
|
||||||
// ruleForm: {},
|
// ruleForm: {},
|
||||||
pickerOptions: {
|
pickerOptions: {
|
||||||
disabledDate(time) {
|
disabledDate(time) {
|
||||||
return time.getTime() > Date.now();
|
return time.getTime() > Date.now()
|
||||||
},
|
},
|
||||||
shortcuts: [
|
shortcuts: [
|
||||||
{
|
{
|
||||||
text: "今天",
|
text: '今天',
|
||||||
onClick(picker) {
|
onClick(picker) {
|
||||||
picker.$emit("pick", new Date());
|
picker.$emit('pick', new Date())
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: "昨天",
|
text: '昨天',
|
||||||
onClick(picker) {
|
onClick(picker) {
|
||||||
const date = new Date();
|
const date = new Date()
|
||||||
date.setTime(date.getTime() - 3600 * 1000 * 24);
|
date.setTime(date.getTime() - 3600 * 1000 * 24)
|
||||||
picker.$emit("pick", date);
|
picker.$emit('pick', date)
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: "一周前",
|
text: '一周前',
|
||||||
onClick(picker) {
|
onClick(picker) {
|
||||||
const date = new Date();
|
const date = new Date()
|
||||||
date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
|
date.setTime(date.getTime() - 3600 * 1000 * 24 * 7)
|
||||||
picker.$emit("pick", date);
|
picker.$emit('pick', date)
|
||||||
},
|
}
|
||||||
},
|
}
|
||||||
],
|
]
|
||||||
},
|
},
|
||||||
tempFormData: {},
|
tempFormData: {}
|
||||||
};
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
ruleForm: {
|
ruleForm: {
|
||||||
immediate: true, // 立即执行
|
immediate: true, // 立即执行
|
||||||
deep: true, // 深度监听复杂类型内变化
|
deep: true, // 深度监听复杂类型内变化
|
||||||
handler(newVal, oldVal) {
|
handler(newVal, oldVal) {
|
||||||
this.$emit("dataChanges");
|
this.$emit('dataChanges')
|
||||||
},
|
}
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
created() {
|
created() {
|
||||||
this.tempFormData = deepClone(this.ruleForm);
|
this.tempFormData = deepClone(this.ruleForm)
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
// this.ruleForm = this.formdata
|
// this.ruleForm = this.formdata
|
||||||
|
@ -506,13 +506,13 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
selectShow(row) {
|
selectShow(row) {
|
||||||
try {
|
try {
|
||||||
this.$emit("selectFormSearch", row);
|
this.$emit('selectFormSearch', row)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(this.ruleForm, row, "23232出错了");
|
console.log(this.ruleForm, row, '23232出错了')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
close() {
|
close() {
|
||||||
this.$emit("closeDialog");
|
this.$emit('closeDialog')
|
||||||
},
|
},
|
||||||
integerNumber(row) {
|
integerNumber(row) {
|
||||||
// row.rules?(v)=>()):''
|
// row.rules?(v)=>()):''
|
||||||
|
@ -521,127 +521,127 @@ export default {
|
||||||
// return this.ruleForm[row.prop].replace(/[^\d]/g,'')
|
// return this.ruleForm[row.prop].replace(/[^\d]/g,'')
|
||||||
//
|
//
|
||||||
// integer整数
|
// integer整数
|
||||||
if (row.rulesName == "integer") {
|
if (row.rulesName == 'integer') {
|
||||||
this.ruleForm[row.prop] = this.ruleForm[row.prop].replace(/[^\d]/g, "");
|
this.ruleForm[row.prop] = this.ruleForm[row.prop].replace(/[^\d]/g, '')
|
||||||
}
|
}
|
||||||
// decimal小数
|
// decimal小数
|
||||||
if (row.rulesName == "decimal") {
|
if (row.rulesName == 'decimal') {
|
||||||
this.ruleForm[row.prop] = this.ruleForm[row.prop]
|
this.ruleForm[row.prop] = this.ruleForm[row.prop]
|
||||||
.replace(/[^\d.]/g, "")
|
.replace(/[^\d.]/g, '')
|
||||||
.replace(/\.{2,}/g, ".")
|
.replace(/\.{2,}/g, '.')
|
||||||
.replace(".", "$#$")
|
.replace('.', '$#$')
|
||||||
.replace(/\./g, "")
|
.replace(/\./g, '')
|
||||||
.replace("$#$", ".")
|
.replace('$#$', '.')
|
||||||
.replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")
|
.replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3')
|
||||||
.replace(/^\./g, "");
|
.replace(/^\./g, '')
|
||||||
}
|
}
|
||||||
// 身份证
|
// 身份证
|
||||||
if (row.rulesName == "identity") {
|
if (row.rulesName == 'identity') {
|
||||||
this.ruleForm[row.prop] = this.ruleForm[row.prop].replace(
|
this.ruleForm[row.prop] = this.ruleForm[row.prop].replace(
|
||||||
/^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/,
|
/^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/,
|
||||||
""
|
''
|
||||||
);
|
)
|
||||||
}
|
}
|
||||||
// 手机号
|
// 手机号
|
||||||
if (row.rulesName == "phone") {
|
if (row.rulesName == 'phone') {
|
||||||
this.ruleForm[row.prop] = this.ruleForm[row.prop].replace(
|
this.ruleForm[row.prop] = this.ruleForm[row.prop].replace(
|
||||||
/^1(3|4|5|7|8|9)\\d{9}$/,
|
/^1(3|4|5|7|8|9)\\d{9}$/,
|
||||||
""
|
''
|
||||||
);
|
)
|
||||||
// this.ruleForm[row.prop] = this.ruleForm[row.prop].replace(/^1[3,4,5,6,7,8,9][0-9]{9}$/, '')
|
// this.ruleForm[row.prop] = this.ruleForm[row.prop].replace(/^1[3,4,5,6,7,8,9][0-9]{9}$/, '')
|
||||||
// this.ruleForm[row.prop] = this.ruleForm[row.prop].replace(/1(\d{2})\d{4}(\d{4})/g,'').replace(/[^\d]/g, '')
|
// this.ruleForm[row.prop] = this.ruleForm[row.prop].replace(/1(\d{2})\d{4}(\d{4})/g,'').replace(/[^\d]/g, '')
|
||||||
// this.ruleForm[row.prop] = this.ruleForm[row.prop].replace(/\.{11,}/g, '')
|
// this.ruleForm[row.prop] = this.ruleForm[row.prop].replace(/\.{11,}/g, '')
|
||||||
// /^1[3|4|5|6|7|8|9][0-9]\d{8}$/
|
// /^1[3|4|5|6|7|8|9][0-9]\d{8}$/
|
||||||
}
|
}
|
||||||
// 邮箱
|
// 邮箱
|
||||||
if (row.rulesName == "eMail") {
|
if (row.rulesName == 'eMail') {
|
||||||
this.ruleForm[row.prop] = this.ruleForm[row.prop].replace(
|
this.ruleForm[row.prop] = this.ruleForm[row.prop].replace(
|
||||||
/^([0-9a-zA-Z_\.\-\])+\@([0-9a-zA-Z_\.\-\])+\.([a-zA-Z]+)$/,
|
/^([0-9a-zA-Z_\.\-\])+\@([0-9a-zA-Z_\.\-\])+\.([a-zA-Z]+)$/,
|
||||||
""
|
''
|
||||||
);
|
)
|
||||||
}
|
}
|
||||||
// this.ruleForm[row.prop] = this.ruleForm[row.prop].replace(/[^\d]/g,'')
|
// this.ruleForm[row.prop] = this.ruleForm[row.prop].replace(/[^\d]/g,'')
|
||||||
},
|
},
|
||||||
//根据地址获取经纬度
|
//根据地址获取经纬度
|
||||||
searchByStationName(type) {
|
searchByStationName(type) {
|
||||||
if (type == "address") {
|
if (type == 'address') {
|
||||||
let address = this.ruleForm[type];
|
let address = this.ruleForm[type]
|
||||||
let that = this;
|
let that = this
|
||||||
var map = new BMap.Map("container");
|
var map = new BMap.Map('container')
|
||||||
map.centerAndZoom(address, 18);
|
map.centerAndZoom(address, 18)
|
||||||
map.enableScrollWheelZoom(); //启用滚轮放大缩小,默认禁用
|
map.enableScrollWheelZoom() //启用滚轮放大缩小,默认禁用
|
||||||
map.enableContinuousZoom(); //启用地图惯性拖拽,默认禁用
|
map.enableContinuousZoom() //启用地图惯性拖拽,默认禁用
|
||||||
map.addControl(new BMap.NavigationControl()); //添加默认缩放平移控件
|
map.addControl(new BMap.NavigationControl()) //添加默认缩放平移控件
|
||||||
map.addControl(new BMap.OverviewMapControl()); //添加默认缩略地图控件
|
map.addControl(new BMap.OverviewMapControl()) //添加默认缩略地图控件
|
||||||
map.addControl(
|
map.addControl(
|
||||||
new BMap.OverviewMapControl({
|
new BMap.OverviewMapControl({
|
||||||
isOpen: true,
|
isOpen: true,
|
||||||
anchor: BMAP_ANCHOR_BOTTOM_RIGHT,
|
anchor: BMAP_ANCHOR_BOTTOM_RIGHT
|
||||||
})
|
})
|
||||||
); //右下角,打开
|
) //右下角,打开
|
||||||
var localSearch = new BMap.LocalSearch(map);
|
var localSearch = new BMap.LocalSearch(map)
|
||||||
localSearch.enableAutoViewport(); //允许自动调节窗体大小
|
localSearch.enableAutoViewport() //允许自动调节窗体大小
|
||||||
map.clearOverlays(); //清空原来的标注
|
map.clearOverlays() //清空原来的标注
|
||||||
var keyword = address;
|
var keyword = address
|
||||||
localSearch.setSearchCompleteCallback(function (searchResult) {
|
localSearch.setSearchCompleteCallback(function(searchResult) {
|
||||||
var poi = searchResult.getPoi(0);
|
var poi = searchResult.getPoi(0)
|
||||||
map.centerAndZoom(poi.point, 13);
|
map.centerAndZoom(poi.point, 13)
|
||||||
var marker = new BMap.Marker(
|
var marker = new BMap.Marker(
|
||||||
new BMap.Point(poi.point.lng, poi.point.lat)
|
new BMap.Point(poi.point.lng, poi.point.lat)
|
||||||
); // 创建标注,为要查询的地方对应的经纬度
|
) // 创建标注,为要查询的地方对应的经纬度
|
||||||
map.addOverlay(marker);
|
map.addOverlay(marker)
|
||||||
var content =
|
var content =
|
||||||
keyword +
|
keyword +
|
||||||
"<br/><br/>经度:" +
|
'<br/><br/>经度:' +
|
||||||
poi.point.lng +
|
poi.point.lng +
|
||||||
"<br/>纬度:" +
|
'<br/>纬度:' +
|
||||||
poi.point.lat;
|
poi.point.lat
|
||||||
that.ruleForm["lng"] = poi.point.lng;
|
that.ruleForm['lng'] = poi.point.lng
|
||||||
that.ruleForm["lat"] = poi.point.lat;
|
that.ruleForm['lat'] = poi.point.lat
|
||||||
var infoWindow = new BMap.InfoWindow(
|
var infoWindow = new BMap.InfoWindow(
|
||||||
"<p style='font-size:14px;'>" + content + "</p>"
|
'<p style=\'font-size:14px;\'>' + content + '</p>'
|
||||||
);
|
)
|
||||||
marker.addEventListener("click", function () {
|
marker.addEventListener('click', function() {
|
||||||
this.openInfoWindow(infoWindow);
|
this.openInfoWindow(infoWindow)
|
||||||
});
|
})
|
||||||
// marker.setAnimation(BMAP_ANIMATION_BOUNCE); //跳动的动画
|
// marker.setAnimation(BMAP_ANIMATION_BOUNCE); //跳动的动画
|
||||||
});
|
})
|
||||||
localSearch.search(keyword);
|
localSearch.search(keyword)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
//计步器
|
//计步器
|
||||||
handleChange(val) {
|
handleChange(val) {
|
||||||
this.$emit("handleChange", val);
|
this.$emit('handleChange', val)
|
||||||
},
|
},
|
||||||
// 获取图片
|
// 获取图片
|
||||||
getImage(imagePath) {
|
getImage(imagePath) {
|
||||||
let licenseImg = imagePath.join(",");
|
let licenseImg = imagePath.join(',')
|
||||||
},
|
},
|
||||||
// 处置前照片
|
// 处置前照片
|
||||||
getbeforeImgList(imagePath) {
|
getbeforeImgList(imagePath) {
|
||||||
let licenseImg = imagePath.join(",");
|
let licenseImg = imagePath.join(',')
|
||||||
this.$set(this.ruleForm, "beforeImgList", licenseImg);
|
this.$set(this.ruleForm, 'beforeImgList', licenseImg)
|
||||||
},
|
},
|
||||||
// 处置材料
|
// 处置材料
|
||||||
getmaterialsList(imagePath) {
|
getmaterialsList(imagePath) {
|
||||||
let licenseImg = imagePath.join(",");
|
let licenseImg = imagePath.join(',')
|
||||||
this.$set(this.ruleForm, "materialsList", licenseImg);
|
this.$set(this.ruleForm, 'materialsList', licenseImg)
|
||||||
},
|
},
|
||||||
// 处置后材料
|
// 处置后材料
|
||||||
getmaterialsListAfter(imagePath) {
|
getmaterialsListAfter(imagePath) {
|
||||||
let licenseImg = imagePath.join(",");
|
let licenseImg = imagePath.join(',')
|
||||||
this.$set(this.ruleForm, "materialsListAfter", licenseImg);
|
this.$set(this.ruleForm, 'materialsListAfter', licenseImg)
|
||||||
},
|
},
|
||||||
revealPhoto(licenseImg) {
|
revealPhoto(licenseImg) {
|
||||||
this.$refs.imgFile.revealImg(licenseImg);
|
this.$refs.imgFile.revealImg(licenseImg)
|
||||||
},
|
},
|
||||||
// 回显数据
|
// 回显数据
|
||||||
echoFromData(echoData, otherField) {
|
echoFromData(echoData, otherField) {
|
||||||
let jsonData = [];
|
let jsonData = []
|
||||||
this.formRow.forEach((item) => {
|
this.formRow.forEach((item) => {
|
||||||
jsonData.push(item.elCol);
|
jsonData.push(item.elCol)
|
||||||
});
|
})
|
||||||
let newJson = [].concat.apply([], jsonData);
|
let newJson = [].concat.apply([], jsonData)
|
||||||
newJson.forEach((item) => {
|
newJson.forEach((item) => {
|
||||||
if (this.ruleForm.factoryInFlag == 1) {
|
if (this.ruleForm.factoryInFlag == 1) {
|
||||||
for (let i = 0; i < this.formRow[8].elCol.length; i++) {
|
for (let i = 0; i < this.formRow[8].elCol.length; i++) {
|
||||||
|
@ -651,31 +651,31 @@ export default {
|
||||||
for (let i = 0; i < this.formRow[8].elCol.length; i++) {
|
for (let i = 0; i < this.formRow[8].elCol.length; i++) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.$set(this.ruleForm, item.prop, echoData[item.prop]);
|
this.$set(this.ruleForm, item.prop, echoData[item.prop])
|
||||||
});
|
})
|
||||||
// 回显自定义多级选择组件
|
// 回显自定义多级选择组件
|
||||||
if (typeof otherField == "object") {
|
if (typeof otherField == 'object') {
|
||||||
this.$refs[otherField.props][0].setEchoData(echoData[otherField.field]);
|
this.$refs[otherField.props][0].setEchoData(echoData[otherField.field])
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 获取指定字段参数
|
// 获取指定字段参数
|
||||||
//参数propLabel , 值value
|
//参数propLabel , 值value
|
||||||
getField(propLabel, value) {
|
getField(propLabel, value) {
|
||||||
this.$set(this.ruleForm, propLabel, value);
|
this.$set(this.ruleForm, propLabel, value)
|
||||||
},
|
},
|
||||||
//弹窗赋值
|
//弹窗赋值
|
||||||
choiceAssignment(value) {
|
choiceAssignment(value) {
|
||||||
this.ruleForm = Object.assign({}, value);
|
this.ruleForm = Object.assign({}, value)
|
||||||
// this.$forceUpdate()
|
// this.$forceUpdate()
|
||||||
},
|
},
|
||||||
incomingParameters(vale) {
|
incomingParameters(vale) {
|
||||||
let ruleLength = 0;
|
let ruleLength = 0
|
||||||
let valeLength = 0;
|
let valeLength = 0
|
||||||
for (let i in vale) {
|
for (let i in vale) {
|
||||||
valeLength = valeLength + 1;
|
valeLength = valeLength + 1
|
||||||
}
|
}
|
||||||
for (let i in this.ruleForm) {
|
for (let i in this.ruleForm) {
|
||||||
ruleLength = ruleLength + 1;
|
ruleLength = ruleLength + 1
|
||||||
}
|
}
|
||||||
// if(ruleLength == valeLength){
|
// if(ruleLength == valeLength){
|
||||||
// this.choiceAssignment(vale)
|
// this.choiceAssignment(vale)
|
||||||
|
@ -685,107 +685,107 @@ export default {
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
for (let i in vale) {
|
for (let i in vale) {
|
||||||
this.getField(i, vale[i]);
|
this.getField(i, vale[i])
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
resetFormPlus(formName) {
|
resetFormPlus(formName) {
|
||||||
for (let i in this.$refs[formName]) {
|
for (let i in this.$refs[formName]) {
|
||||||
this.getField(i, "");
|
this.getField(i, '')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 重置表单字段
|
// 重置表单字段
|
||||||
resetField(field) {
|
resetField(field) {
|
||||||
if (this.ruleForm[field]) {
|
if (this.ruleForm[field]) {
|
||||||
this.$set(this.ruleForm, field, "");
|
this.$set(this.ruleForm, field, '')
|
||||||
this.$refs["ruleForm"].clearValidate(field); // 清除表单特定属性
|
this.$refs['ruleForm'].clearValidate(field) // 清除表单特定属性
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
resetFields() {
|
resetFields() {
|
||||||
// this.choiceAssignment({});
|
// this.choiceAssignment({});
|
||||||
this.$refs.ruleForm.resetFields();
|
this.$refs.ruleForm.resetFields()
|
||||||
},
|
},
|
||||||
// 下拉框更改,可根据 index 与 indexRow 定位具体位置
|
// 下拉框更改,可根据 index 与 indexRow 定位具体位置
|
||||||
selectChange(val, index, indexRow, options) {
|
selectChange(val, index, indexRow, options) {
|
||||||
let obj = {};
|
let obj = {}
|
||||||
options.forEach((item) => {
|
options.forEach((item) => {
|
||||||
if (item.value == val) {
|
if (item.value == val) {
|
||||||
obj = item;
|
obj = item
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
this.$emit("onSelect", val, index, indexRow, obj);
|
this.$emit('onSelect', val, index, indexRow, obj)
|
||||||
this.$forceUpdate();
|
this.$forceUpdate()
|
||||||
},
|
},
|
||||||
switchChange(val, index, indexRow, row) {
|
switchChange(val, index, indexRow, row) {
|
||||||
this.$emit("switchChange", val, index, indexRow, row);
|
this.$emit('switchChange', val, index, indexRow, row)
|
||||||
},
|
},
|
||||||
// 自定义级联选择器返回值
|
// 自定义级联选择器返回值
|
||||||
getCascader(value, field) {
|
getCascader(value, field) {
|
||||||
this.$set(this.ruleForm, field, value);
|
this.$set(this.ruleForm, field, value)
|
||||||
},
|
},
|
||||||
// 表单提交
|
// 表单提交
|
||||||
submitForm() {
|
submitForm() {
|
||||||
let formName = "ruleForm";
|
let formName = 'ruleForm'
|
||||||
this.$refs[formName].validate((valid) => {
|
this.$refs[formName].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
// 判断是否有更改
|
// 判断是否有更改
|
||||||
let flag =
|
let flag =
|
||||||
JSON.stringify(this.tempFormData) === JSON.stringify(this.ruleForm);
|
JSON.stringify(this.tempFormData) === JSON.stringify(this.ruleForm)
|
||||||
this.$emit("onSubmit", this.ruleForm, flag);
|
this.$emit('onSubmit', this.ruleForm, flag)
|
||||||
} else {
|
} else {
|
||||||
console.log("error submit!!");
|
console.log('error submit!!')
|
||||||
return false;
|
return false
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
// 表单重置
|
// 表单重置
|
||||||
resetForm(formName) {
|
resetForm(formName) {
|
||||||
let tempObj = deepClone(this.tempFormData);
|
let tempObj = deepClone(this.tempFormData)
|
||||||
// // this.tableColumn
|
// // this.tableColumn
|
||||||
// // .filter((item) => item.disabled)
|
// // .filter((item) => item.disabled)
|
||||||
// // .forEach((item) => {
|
// // .forEach((item) => {
|
||||||
// // tempObj[item.id] = this.ruleForm[item.id];
|
// // tempObj[item.id] = this.ruleForm[item.id];
|
||||||
// // });
|
// // });
|
||||||
// // this.choiceAssignment({});
|
// // this.choiceAssignment({});
|
||||||
this.$confirm("确认要重置表单吗?", "提示", {
|
this.$confirm('确认要重置表单吗?', '提示', {
|
||||||
confirmButtonText: "确定",
|
confirmButtonText: '确定',
|
||||||
cancelButtonText: "取消",
|
cancelButtonText: '取消',
|
||||||
type: "warning",
|
type: 'warning'
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
this.$emit("resetForm", tempObj);
|
this.$emit('resetForm', tempObj)
|
||||||
this.$refs[formName].resetFields();
|
this.$refs[formName].resetFields()
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
this.$message({
|
this.$message({
|
||||||
type: "info",
|
type: 'info',
|
||||||
message: "已取消重置",
|
message: '已取消重置'
|
||||||
});
|
})
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
clearCheck(propName) {
|
clearCheck(propName) {
|
||||||
this.ruleForm[propName] = "";
|
this.ruleForm[propName] = ''
|
||||||
},
|
},
|
||||||
elDialogClick(row, index, indexRow) {
|
elDialogClick(row, index, indexRow) {
|
||||||
if (row.disabled) {
|
if (row.disabled) {
|
||||||
return;
|
return
|
||||||
}
|
}
|
||||||
// row.prop
|
// row.prop
|
||||||
this.$emit("elDialogClick", row, index);
|
this.$emit('elDialogClick', row, index)
|
||||||
},
|
},
|
||||||
elDialogHover(row) {
|
elDialogHover(row) {
|
||||||
row.elDialogHoverType = true;
|
row.elDialogHoverType = true
|
||||||
},
|
},
|
||||||
elDialogLeave(row) {
|
elDialogLeave(row) {
|
||||||
// row.elDialogHoverType = false
|
// row.elDialogHoverType = false
|
||||||
},
|
},
|
||||||
// 单选按钮组input事件
|
// 单选按钮组input事件
|
||||||
changeRadio(val, index, indexRow, row) {
|
changeRadio(val, index, indexRow, row) {
|
||||||
this.$emit("onChangeRadio", val, index, indexRow, row);
|
this.$emit('onChangeRadio', val, index, indexRow, row)
|
||||||
},
|
},
|
||||||
normalizer(node, row) {
|
normalizer(node, row) {
|
||||||
//去掉children=null的属性
|
//去掉children=null的属性
|
||||||
if (node.children == null || node.children == "null") {
|
if (node.children == null || node.children == 'null') {
|
||||||
delete node.children;
|
delete node.children
|
||||||
}
|
}
|
||||||
// return{
|
// return{
|
||||||
// ...node,
|
// ...node,
|
||||||
|
@ -793,22 +793,22 @@ export default {
|
||||||
// }
|
// }
|
||||||
},
|
},
|
||||||
selectTree(row) {
|
selectTree(row) {
|
||||||
console.log(row);
|
console.log(row)
|
||||||
this.$emit("selectTree");
|
this.$emit('selectTree')
|
||||||
if (this.$refs.ruleForm) {
|
if (this.$refs.ruleForm) {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$refs.ruleForm.validateField(row.id);
|
this.$refs.ruleForm.validateField(row.id)
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
treeSelectClear() {
|
treeSelectClear() {
|
||||||
this.$refs.selectTree.clear();
|
this.$refs.selectTree.clear()
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
// this.$refs.ruleForm.resetFields();
|
// this.$refs.ruleForm.resetFields();
|
||||||
},
|
}
|
||||||
};
|
}
|
||||||
</script>
|
</script>
|
||||||
<style>
|
<style>
|
||||||
.el-form-item__label {
|
.el-form-item__label {
|
||||||
|
@ -817,8 +817,9 @@ export default {
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-form-item--medium .el-form-item__content {
|
.el-form-item--medium .el-form-item__content {
|
||||||
/* line-height: 36px; */
|
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-form-item.is-required:not(.is-no-asterisk) > .el-form-item__label:before {
|
.el-form-item.is-required:not(.is-no-asterisk) > .el-form-item__label:before {
|
||||||
|
@ -826,7 +827,7 @@ export default {
|
||||||
content: "";
|
content: "";
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<style scoped lang='scss'>
|
<style scoped lang="scss">
|
||||||
.label {
|
.label {
|
||||||
/* @include fontBase(16px, #333333) ; */
|
/* @include fontBase(16px, #333333) ; */
|
||||||
color: #333;
|
color: #333;
|
||||||
|
@ -922,4 +923,7 @@ export default {
|
||||||
resize: none;
|
resize: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
::v-deep .el-form-item__label{
|
||||||
|
padding: 0 !important;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -98,7 +98,7 @@
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<!-- 定义插槽:父组件可以使用 v-slot:prop="{row}" 搭配template标签,自定义每一列单元格的样式与操作 -->
|
<!-- 定义插槽:父组件可以使用 v-slot:prop="{row}" 搭配template标签,自定义每一列单元格的样式与操作 -->
|
||||||
<slot :name="item.id" :row="slotrow ? scope : scope.row">
|
<slot :name="item.id" :row="slotrow ? scope : scope.row">
|
||||||
<template v-if="scope.$index + 1 != tableInfo.tableData.length">
|
<template v-if="scope.$index + 1 != tableInfo.tableData.length || lookflag">
|
||||||
<template v-if="!lookflag">
|
<template v-if="!lookflag">
|
||||||
<el-input
|
<el-input
|
||||||
v-if="item.type === 'input' || item.type === 'textrea'"
|
v-if="item.type === 'input' || item.type === 'textrea'"
|
||||||
|
|
|
@ -565,6 +565,7 @@ export default {
|
||||||
this.dialogFormName = res.attribute.mainMdmModuleDb.dbName
|
this.dialogFormName = res.attribute.mainMdmModuleDb.dbName
|
||||||
this.formRow = []
|
this.formRow = []
|
||||||
this.baseFormRowDispose(res.attribute.mainMdmModuleDb.sublistMdmModuleDbFileds, this.formRow)
|
this.baseFormRowDispose(res.attribute.mainMdmModuleDb.sublistMdmModuleDbFileds, this.formRow)
|
||||||
|
console.log(this.formRow, 'this.formRow')
|
||||||
//子表处理
|
//子表处理
|
||||||
this.dialogTabaleInfo = []
|
this.dialogTabaleInfo = []
|
||||||
res.attribute.sublistMdmModuleDb.forEach(table => {
|
res.attribute.sublistMdmModuleDb.forEach(table => {
|
||||||
|
@ -853,8 +854,8 @@ export default {
|
||||||
this.appSearch(item.appId, item)
|
this.appSearch(item.appId, item)
|
||||||
})
|
})
|
||||||
this.rowId = id
|
this.rowId = id
|
||||||
this.sendCheckboxType=''
|
this.sendCheckboxType = ''
|
||||||
this.sendCheckboxList=''
|
this.sendCheckboxList = ''
|
||||||
this.sendShow = true
|
this.sendShow = true
|
||||||
},
|
},
|
||||||
//应用名查找
|
//应用名查找
|
||||||
|
|
|
@ -48,7 +48,7 @@ const optionFormRow = [
|
||||||
required: true,
|
required: true,
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
pattern: /^[a-z][a-z0-9_]{0,50}$/,
|
pattern: /^[a-z][a-z0-9_]{0,50}$/,
|
||||||
message: "须以需字母开头且字母小写且不能出现_外的字符与中文",
|
message: "必须以小写字母开头,只能包含小写字母、数字和下划线,不能包含中文字符或其他符号。",
|
||||||
disabledOfId: true,
|
disabledOfId: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
|
@ -100,7 +100,7 @@ export default {
|
||||||
required: true,
|
required: true,
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
pattern: /^[a-z][a-z0-9_]{0,50}$/,
|
pattern: /^[a-z][a-z0-9_]{0,50}$/,
|
||||||
message: "须以需字母开头且字母小写且不能出现_外的字符与中文",
|
message: "必须以小写字母开头,只能包含小写字母、数字和下划线,不能包含中文字符或其他符号。",
|
||||||
disabledOfId: true
|
disabledOfId: true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in New Issue