Commit d95f7d26 authored by 王纵's avatar 王纵

表单只读

parent f5ee7b1c
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: zong.wang01@hand-china.com * @Author: zong.wang01@hand-china.com
* @Date: 2024-08-01 09:55:12 * @Date: 2024-08-01 09:55:12
* @LastEditors: zong.wang01@hand-china.com * @LastEditors: zong.wang01@hand-china.com
* @LastEditTime: 2024-08-13 15:47:01 * @LastEditTime: 2024-08-14 10:29:59
* @Version: 1.0.0 * @Version: 1.0.0
* @Description: 动态渲染-复选框组件 * @Description: 动态渲染-复选框组件
* @Copyright: Copyright (c) 2021, Hand-RongJing * @Copyright: Copyright (c) 2021, Hand-RongJing
...@@ -86,7 +86,7 @@ export default { ...@@ -86,7 +86,7 @@ export default {
}, },
methods: { methods: {
checked (flag) { checked (flag) {
if (!this.disable) { if (!this.disabled) {
this.$emit('input', flag) this.$emit('input', flag)
this.$emit('change', flag) this.$emit('change', flag)
} }
...@@ -96,5 +96,5 @@ export default { ...@@ -96,5 +96,5 @@ export default {
</script> </script>
<style lang="less"> <style lang="less">
@import './index.less'; // @import './index.less';
</style> </style>
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: zong.wang01@hand-china.com * @Author: zong.wang01@hand-china.com
* @Date: 2024-08-01 09:55:12 * @Date: 2024-08-01 09:55:12
* @LastEditors: zong.wang01@hand-china.com * @LastEditors: zong.wang01@hand-china.com
* @LastEditTime: 2024-08-14 09:29:36 * @LastEditTime: 2024-08-14 10:31:08
* @Version: 1.0.0 * @Version: 1.0.0
* @Description: 动态渲染-日期组件 * @Description: 动态渲染-日期组件
* @Copyright: Copyright (c) 2021, Hand-RongJing * @Copyright: Copyright (c) 2021, Hand-RongJing
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<van-field <van-field
readonly readonly
v-model="currentValue" v-model="currentValue"
placeholder="请选择" :placeholder="disabled ? '' : '请选择'"
:name="name" :name="name"
:disabled="disabled" :disabled="disabled"
:required="required" :required="required"
...@@ -30,9 +30,9 @@ ...@@ -30,9 +30,9 @@
:error="false" :error="false"
> >
<d-label :label="label" :help="help" slot="label" /> <d-label :label="label" :help="help" slot="label" />
<template slot="right-icon" > <template slot="right-icon">
<van-icon name="clear" v-show="!disabled && clearable && currentValue" @click="clear"/> <van-icon name="clear" v-show="!disabled && clearable && currentValue" @click="clear"/>
<img src="../../../assets/date-icon.png" alt="" class="right-icon"/> <img src="../../../assets/date-icon.png" alt="" class="right-icon" v-show="!disabled"/>
</template> </template>
</van-field> </van-field>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: zong.wang01@hand-china.com * @Author: zong.wang01@hand-china.com
* @Date: 2024-08-01 09:55:12 * @Date: 2024-08-01 09:55:12
* @LastEditors: zong.wang01@hand-china.com * @LastEditors: zong.wang01@hand-china.com
* @LastEditTime: 2024-08-13 15:46:33 * @LastEditTime: 2024-08-14 10:57:14
* @Version: 1.0.0 * @Version: 1.0.0
* @Description: 动态渲染-文本框组件 * @Description: 动态渲染-文本框组件
* @Copyright: Copyright (c) 2021, Hand-RongJing * @Copyright: Copyright (c) 2021, Hand-RongJing
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<div class="d-form-item"> <div class="d-form-item">
<van-field <van-field
v-model="currentValue" v-model="currentValue"
placeholder="请输入" :placeholder="disabled ? '' : '请选择'"
@input="fieldInput" @input="fieldInput"
:name="name" :name="name"
:type="fieldType[type]" :type="fieldType[type]"
...@@ -21,6 +21,8 @@ ...@@ -21,6 +21,8 @@
:formatter="formatter" :formatter="formatter"
:rules="[{ required, message: `请输入${label}` }]" :rules="[{ required, message: `请输入${label}` }]"
:error="false" :error="false"
:class="type === 'TextArea' ? 'd-form-textarea' : ''"
clear-trigger="always"
> >
<d-label :label="label" :help="help" slot="label" /> <d-label :label="label" :help="help" slot="label" />
<span slot="extra" v-if="type === 'CentField'">%</span> <span slot="extra" v-if="type === 'CentField'">%</span>
...@@ -115,5 +117,5 @@ export default { ...@@ -115,5 +117,5 @@ export default {
</script> </script>
<style lang="less"> <style lang="less">
@import './index.less'; // @import './index.less';
</style> </style>
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: zong.wang01@hand-china.com * @Author: zong.wang01@hand-china.com
* @Date: 2024-08-01 09:55:12 * @Date: 2024-08-01 09:55:12
* @LastEditors: zong.wang01@hand-china.com * @LastEditors: zong.wang01@hand-china.com
* @LastEditTime: 2024-08-14 09:28:23 * @LastEditTime: 2024-08-14 10:26:23
* @Version: 1.0.0 * @Version: 1.0.0
* @Description: 动态渲染-Lov * @Description: 动态渲染-Lov
* @Copyright: Copyright (c) 2021, Hand-RongJing * @Copyright: Copyright (c) 2021, Hand-RongJing
...@@ -34,13 +34,13 @@ ...@@ -34,13 +34,13 @@
<d-label :label="label" :help="help" slot="label" /> <d-label :label="label" :help="help" slot="label" />
<template #input> <template #input>
<div @click="changeVisible(true)" class="cell-value"> <div @click="changeVisible(true)" class="cell-value">
<span v-if="!currentValue || currentValue.length === 0" class="placeholder">请选择</span> <span v-if="!currentValue || currentValue.length === 0" class="placeholder">{{disabled ? '' : '请选择'}}</span>
<span v-else>{{valueDisplay()}}</span> <span v-else>{{valueDisplay()}}</span>
</div> </div>
</template> </template>
<template slot="right-icon" > <template slot="right-icon" >
<van-icon name="clear" v-show="!disabled && clearable && !(!currentValue || currentValue.length === 0)" @click="clear"/> <van-icon name="clear" v-show="!disabled && clearable && !(!currentValue || currentValue.length === 0)" @click="clear"/>
<van-icon name="arrow" /> <van-icon name="arrow" v-show="!disabled" />
</template> </template>
</van-field> </van-field>
...@@ -271,7 +271,7 @@ export default { ...@@ -271,7 +271,7 @@ export default {
</script> </script>
<style lang="less"> <style lang="less">
@import './index.less'; // @import './index.less';
.d-lov-popup { .d-lov-popup {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: zong.wang01@hand-china.com * @Author: zong.wang01@hand-china.com
* @Date: 2024-08-01 09:55:12 * @Date: 2024-08-01 09:55:12
* @LastEditors: zong.wang01@hand-china.com * @LastEditors: zong.wang01@hand-china.com
* @LastEditTime: 2024-08-14 09:28:54 * @LastEditTime: 2024-08-14 11:01:18
* @Version: 1.0.0 * @Version: 1.0.0
* @Description: 动态渲染-Select * @Description: 动态渲染-Select
* @Copyright: Copyright (c) 2021, Hand-RongJing * @Copyright: Copyright (c) 2021, Hand-RongJing
...@@ -32,13 +32,13 @@ ...@@ -32,13 +32,13 @@
<d-label :label="label" :help="help" slot="label" /> <d-label :label="label" :help="help" slot="label" />
<template #input> <template #input>
<div @click="showSelectOption(true)" class="cell-value"> <div @click="showSelectOption(true)" class="cell-value">
<span v-if="!(currentValue.length || currentValue.meaning)" class="placeholder">请选择</span> <span v-if="!(currentValue.length || currentValue.meaning)" class="placeholder">{{disabled ? '' : '请选择'}}</span>
<span v-else>{{valueDisplay()}}</span> <span v-else>{{valueDisplay()}}</span>
</div> </div>
</template> </template>
<template slot="right-icon" > <template slot="right-icon" >
<van-icon name="clear" v-show="!disabled && clearable && (currentValue.length || currentValue.meaning)" @click="clear"/> <van-icon name="clear" v-show="!disabled && clearable && (currentValue.length || currentValue.meaning)" @click="clear"/>
<van-icon name="arrow" /> <van-icon name="arrow" v-show="!disabled"/>
</template> </template>
</van-field> </van-field>
...@@ -207,7 +207,10 @@ export default { ...@@ -207,7 +207,10 @@ export default {
}, },
selectOption(val, index) { selectOption(val, index) {
if (!this.multiple) { if (!this.multiple) {
this.options = this.options.map(o => ({...o, _selected: false})) this.options = this.options.map(o => ({...o, _selected: false}));
this.currentValue = val;
this.inputValue(this.currentValue.value);
this.showSelectOption(false);
} }
this.$set(this.options[index], '_selected', !this.options[index]._selected); this.$set(this.options[index], '_selected', !this.options[index]._selected);
}, },
...@@ -228,7 +231,7 @@ export default { ...@@ -228,7 +231,7 @@ export default {
</script> </script>
<style lang="less"> <style lang="less">
@import './index.less'; @import '../../../index.less';
.d-select-popup { .d-select-popup {
max-height: 60%; max-height: 60%;
.title{ .title{
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: zong.wang01@hand-china.com * @Author: zong.wang01@hand-china.com
* @Date: 2024-08-01 09:55:12 * @Date: 2024-08-01 09:55:12
* @LastEditors: zong.wang01@hand-china.com * @LastEditors: zong.wang01@hand-china.com
* @LastEditTime: 2024-08-13 15:48:06 * @LastEditTime: 2024-08-14 10:30:25
* @Version: 1.0.0 * @Version: 1.0.0
* @Description: 动态渲染-开关组件 * @Description: 动态渲染-开关组件
* @Copyright: Copyright (c) 2021, Hand-RongJing * @Copyright: Copyright (c) 2021, Hand-RongJing
...@@ -85,7 +85,7 @@ export default { ...@@ -85,7 +85,7 @@ export default {
}, },
methods: { methods: {
checked (flag) { checked (flag) {
if (!this.disable) { if (!this.disabled) {
this.$emit('input', flag ? 1 : 0); this.$emit('input', flag ? 1 : 0);
this.$emit('change', flag ? 1 : 0); this.$emit('change', flag ? 1 : 0);
} }
...@@ -95,5 +95,5 @@ export default { ...@@ -95,5 +95,5 @@ export default {
</script> </script>
<style lang="less"> <style lang="less">
@import './index.less'; // @import './index.less';
</style> </style>
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: zong.wang01@hand-china.com * @Author: zong.wang01@hand-china.com
* @Date: 2024-08-01 09:55:12 * @Date: 2024-08-01 09:55:12
* @LastEditors: zong.wang01@hand-china.com * @LastEditors: zong.wang01@hand-china.com
* @LastEditTime: 2024-08-11 10:44:31 * @LastEditTime: 2024-08-14 10:30:30
* @Version: 1.0.0 * @Version: 1.0.0
* @Description: 动态渲染-超链接组件 * @Description: 动态渲染-超链接组件
* @Copyright: Copyright (c) 2021, Hand-RongJing * @Copyright: Copyright (c) 2021, Hand-RongJing
...@@ -63,18 +63,12 @@ export default { ...@@ -63,18 +63,12 @@ export default {
} }
}, },
methods: { methods: {
checked (flag) {
if (!this.disable) {
this.$emit('input', flag)
this.$emit('change', flag)
}
},
}, },
} }
</script> </script>
<style lang="less"> <style lang="less">
@import './index.less'; // @import './index.less';
.d-url { .d-url {
padding: 6px 14px; padding: 6px 14px;
......
...@@ -3,12 +3,12 @@ ...@@ -3,12 +3,12 @@
.d-form-item { .d-form-item {
position: relative; position: relative;
.value-input { // .value-input {
text-align: right; // text-align: right;
&::-webkit-input-placeholder, textarea::-webkit-input-placeholder { // &::-webkit-input-placeholder, textarea::-webkit-input-placeholder {
color: #B4B4B5; // color: #B4B4B5;
} // }
} // }
.placeholder { .placeholder {
text-align: right; text-align: right;
color: #B4B4B5; color: #B4B4B5;
...@@ -21,21 +21,32 @@ ...@@ -21,21 +21,32 @@
.right-icon { .right-icon {
width: 16px; width: 16px;
} }
.value-input { // .value-input {
text-align: right; // text-align: right;
&::-webkit-input-placeholder, textarea::-webkit-input-placeholder { // &::-webkit-input-placeholder, textarea::-webkit-input-placeholder {
color: #B4B4B5; // color: #B4B4B5;
} // }
// }
}
.d-form-textarea { // 文本域
display: flex;
flex-direction: column;
.van-field__control {
text-align: left;
} }
} }
.van-icon { .van-icon {
color: #B4B4B5; color: #B4B4B5;
} }
.van-cell__title { .van-cell__title {
min-width: 40%; // min-width: 40%;
max-width: 50%;
width: auto;
} }
.van-field--disabled .van-cell__title { .van-field--disabled {
color: #c8c9cc; .cell-value {
color: #656262;
}
} }
.van-field__right-icon { .van-field__right-icon {
...@@ -60,5 +71,5 @@ ...@@ -60,5 +71,5 @@
border-bottom: 1px solid #ebedf0; border-bottom: 1px solid #ebedf0;
-webkit-transform: scaleY(.5); -webkit-transform: scaleY(.5);
transform: scaleY(.5); transform: scaleY(.5);
} }
} }
\ No newline at end of file
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: zong.wang01@hand-china.com * @Author: zong.wang01@hand-china.com
* @Date: 2024-07-29 10:51:56 * @Date: 2024-07-29 10:51:56
* @LastEditors: zong.wang01@hand-china.com * @LastEditors: zong.wang01@hand-china.com
* @LastEditTime: 2024-08-13 13:02:20 * @LastEditTime: 2024-08-14 10:48:44
* @Version: 1.0.0 * @Version: 1.0.0
* @Description: * @Description:
* @Copyright: Copyright (c) 2021, Hand-RongJing * @Copyright: Copyright (c) 2021, Hand-RongJing
...@@ -80,7 +80,7 @@ export default { ...@@ -80,7 +80,7 @@ export default {
}; };
}, },
created() { created() {
window.localStorage.setItem('access_token', '5d974657-7d25-4a4a-8195-6266f308a863'); window.localStorage.setItem('access_token', 'eee48cb3-3db0-4a82-99dd-3168b9610a8c');
this.params = { this.params = {
...this.$route.params, ...this.$route.params,
...this.$route.query ...this.$route.query
......
...@@ -10,6 +10,8 @@ ...@@ -10,6 +10,8 @@
// field // field
@field-error-message-color: #FF4837; @field-error-message-color: #FF4837;
@field-input-disabled-text-color: #656262;
@field-disabled-text-color: rgba(101, 102, 102, 0.804);
// picker组件 // picker组件
@text-link-color: @primary-color; @text-link-color: @primary-color;
......
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