Commit b6fa960f authored by wcmoon's avatar wcmoon

fix: 模版保存新增三种表现形式完成

parent fa32a3a1
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
<base-form <base-form
:label="property.label" :label="property.label"
:watchValue="property.value" :watchValue="property.value"
@changeValue="change"
></base-form> ></base-form>
</template> </template>
...@@ -18,6 +19,10 @@ import {Property} from "@/plugins/types2"; ...@@ -18,6 +19,10 @@ import {Property} from "@/plugins/types2";
export default class ImageUrlForm extends Vue { export default class ImageUrlForm extends Vue {
@Prop() property!: Property; @Prop() property!: Property;
public change(inputValue: string) {
this.property.value = inputValue;
}
} }
</script> </script>
......
...@@ -52,16 +52,35 @@ export default class JsonForm extends Vue { ...@@ -52,16 +52,35 @@ export default class JsonForm extends Vue {
@Watch('jsons') @Watch('jsons')
jsonsChange() { jsonsChange() {
let temp:any = {};
// this.property.value = this.jsons.forEach((item) => {
temp[item.key] = item.value;
})
this.property.value = JSON.stringify(temp);
} }
mounted() { mounted() {
console.log(this.property); const o = JSON.parse(this.property.value as string || '{}');
this.jsons = [];
for (let i in o) {
this.jsons.push({
key: i,
value: o[i]
})
}
if (this.jsons.length <= 0) {
this.jsons.push({
key: '',
value: ''
})
}
} }
public change() { public change() {
let temp:any = {};
this.jsons.forEach((item) => {
temp[item.key] = item.value;
})
this.property.value = JSON.stringify(temp);
} }
public add() { public add() {
this.jsons.push({ this.jsons.push({
......
const configModules = { const configModules = {
// 溯源>测试环境 // 溯源>测试环境
"sy_test": { "sy_test": {
CHAIN_BROWSER_URL_PREFIX: 'http://120.26.174.69:9032/', CHAIN_BROWSER_URL_PREFIX: 'http://47.114.159.142:8995/',
INERFACE_URL_PREFIX: 'http://172.16.101.87:46789', INERFACE_URL_PREFIX: 'http://172.16.101.87:46789',
/** /**
* 网站入口配置 * 网站入口配置
...@@ -19,8 +19,10 @@ const configModules = { ...@@ -19,8 +19,10 @@ const configModules = {
"sy_prod": { "sy_prod": {
// CHAIN_BROWSER_URL_PREFIX: 'https://cx.chain33.pro/', // CHAIN_BROWSER_URL_PREFIX: 'https://cx.chain33.pro/',
// INERFACE_URL_PREFIX: 'https://sy.chain33.pro/api', // INERFACE_URL_PREFIX: 'https://sy.chain33.pro/api',
CHAIN_BROWSER_URL_PREFIX: 'http://172.16.101.87:8995/', // CHAIN_BROWSER_URL_PREFIX: 'http://172.16.101.87:8995/',
INERFACE_URL_PREFIX: 'http://172.16.101.87:8994/', // INERFACE_URL_PREFIX: 'http://172.16.101.87:8994/',
CHAIN_BROWSER_URL_PREFIX: 'http://47.114.159.142:8995/',
INERFACE_URL_PREFIX: 'http://172.16.101.87:46789',
INDEX: { INDEX: {
entry: './src/entry/sy/main.ts', entry: './src/entry/sy/main.ts',
template: './public/sy/index.html', template: './public/sy/index.html',
......
import { import {PropertyType, RootUnit as RootUnitType, TemplateProperty, TmplSelectProperty, UnitProperty,} from "./types";
PropertyType, import {Property, Unit} from "./types2";
RootUnit as RootUnitType,
TmplSelectProperty,
TemplateProperty,
UnitProperty,
} from "./types";
import { Property, Unit } from "./types2";
/** /**
* 将本地模板转换为接口json * 将本地模板转换为接口json
...@@ -113,6 +107,17 @@ function formatProperty2Api(property: Property): TemplateProperty | TmplSelectPr ...@@ -113,6 +107,17 @@ function formatProperty2Api(property: Property): TemplateProperty | TmplSelectPr
key: property.parent.title === 'ext' ? property.label : property.key, key: property.parent.title === 'ext' ? property.label : property.key,
label: property.label label: property.label
}; };
} else if (property.type === PropertyType.JSON || property.type === PropertyType.ImageUrl) {
return {
data: {
format: 'string',
type: 'text',
value: property.value
},
type: property.type,
key: property.label,
label: property.label
};
} else if (property.type === PropertyType.Date) { } else if (property.type === PropertyType.Date) {
return { return {
data: { data: {
......
...@@ -100,7 +100,7 @@ ...@@ -100,7 +100,7 @@
}" }"
> >
<i class="iconfont iconbaocun-"></i> <i class="iconfont iconbaocun-"></i>
保存模板{{TemplateType}} 保存模板
</div> </div>
</div> </div>
</div> </div>
......
rm -rf sy rm -rf sy
mv dist sy mv dist sy
tar -czf sy.tar sy tar -czf sy.tar sy
scp sy.tar root@120.26.174.69:/usr/share/nginx/html/sy.tar scp sy.tar root@47.114.159.142:/usr/share/nginx/sy.tar
rm -rf sy.tar rm -rf sy.tar
ssh root@120.26.174.69 'cd /usr/share/nginx/html && rm -rf sy && tar -xzf sy.tar && rm -rf sy.tar' ssh root@47.114.159.142 'cd /usr/share/nginx && rm -rf sy && tar -xzf sy.tar && rm -rf sy.tar'
echo 'done. 👉 http://120.26.174.69/sy/(http://120.26.174.69:8994/)' echo 'done. 👉 http://47.114.159.142:8994'
\ No newline at end of file
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